fix: convert posted price formatted values to numeric
This commit is contained in:
parent
b9e3ba2503
commit
f945ec5771
@ -196,7 +196,7 @@ if (empty($reshook))
|
|||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Supplier")), null, '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
|
if ($price_expression === '') // Return error of missing price only if price_expression not set
|
||||||
{
|
{
|
||||||
@ -215,12 +215,12 @@ if (empty($reshook))
|
|||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Currency")), null, '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++;
|
$error++;
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("CurrencyRate")), null, '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++;
|
$error++;
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("PriceCurrency")), null, 'errors');
|
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("PriceCurrency")), null, 'errors');
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user