From 4912f6a7205865df407b391e939a74e3f4218f1b Mon Sep 17 00:00:00 2001 From: daraelmin Date: Sat, 19 Nov 2022 22:15:58 +0100 Subject: [PATCH] Fix #22675 - avoid warning when weight is empty --- htdocs/core/lib/functions2.lib.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index 9808fbb28b9..6582665ce73 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -1755,6 +1755,7 @@ function weight_convert($weight, &$from_unit, $to_unit) * weigh_convert(320, $f, 0) retournera 0.32 * */ + $weight = is_numeric($weight) ? $weight : 0; while ($from_unit <> $to_unit) { if ($from_unit > $to_unit) { $weight = $weight * 10;