Fix #22675 - avoid warning when weight is empty
This commit is contained in:
parent
e480b7cabb
commit
4912f6a720
@ -1755,6 +1755,7 @@ function weight_convert($weight, &$from_unit, $to_unit)
|
|||||||
* weigh_convert(320, $f, 0) retournera 0.32
|
* weigh_convert(320, $f, 0) retournera 0.32
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
$weight = is_numeric($weight) ? $weight : 0;
|
||||||
while ($from_unit <> $to_unit) {
|
while ($from_unit <> $to_unit) {
|
||||||
if ($from_unit > $to_unit) {
|
if ($from_unit > $to_unit) {
|
||||||
$weight = $weight * 10;
|
$weight = $weight * 10;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user