From f945ec57718808bb974efe6893e9ac88aec53720 Mon Sep 17 00:00:00 2001 From: Abbes Bahfir Date: Mon, 2 Sep 2019 21:18:57 +0100 Subject: [PATCH] fix: convert posted price formatted values to numeric --- htdocs/product/fournisseurs.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index 587d494a51f..cb56ff63cfc 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -196,7 +196,7 @@ if (empty($reshook)) $langs->load("errors"); setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Supplier")), null, 'errors'); } - if ($_POST["price"] < 0 || $_POST["price"] == '') + if (price2num($_POST["price"]) < 0 || $_POST["price"] == '') { if ($price_expression === '') // Return error of missing price only if price_expression not set { @@ -215,12 +215,12 @@ if (empty($reshook)) $langs->load("errors"); setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Currency")), null, 'errors'); } - if ($_POST["multicurrency_tx"] <= 0 || $_POST["multicurrency_tx"] == '') { + if (price2num($_POST["multicurrency_tx"]) <= 0 || $_POST["multicurrency_tx"] == '') { $error++; $langs->load("errors"); setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("CurrencyRate")), null, 'errors'); } - if ($_POST["multicurrency_price"] < 0 || $_POST["multicurrency_price"] == '') { + if (price2num($_POST["multicurrency_price"]) < 0 || $_POST["multicurrency_price"] == '') { $error++; $langs->load("errors"); setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("PriceCurrency")), null, 'errors');