Cast to float, to avoid performing arithmetic with strings (https://github.com/woocommerce/woocommerce-admin/pull/4042)

This commit is contained in:
Barry Hughes 2020-04-01 12:09:38 -07:00 committed by GitHub
parent ee0eec8a40
commit 801cd357a0
1 changed files with 1 additions and 1 deletions

View File

@ -31,7 +31,7 @@ trait OrderTraits {
return 0; return 0;
} }
$total_shipping_amount = $this->get_shipping_total(); $total_shipping_amount = (float) $this->get_shipping_total();
return $total_shipping_amount / $order_items * $product_qty; return $total_shipping_amount / $order_items * $product_qty;
} }