Add test to avoid bad input
This commit is contained in:
parent
dc8782edde
commit
443e8d1710
@ -894,6 +894,12 @@ if (($action == 'addline' || $action == 'addline_predef') && $user->rights->fact
|
||||
{
|
||||
$result=0;
|
||||
|
||||
if ($_POST['np_price'] < 0 && $_POST["qty"] < 0)
|
||||
{
|
||||
$langs->load("errors");
|
||||
$mesg='<div class="error">'.$langs->trans("ErrorBothFieldCantBeNegative",$langs->transnoentitiesnoconv("UnitPriceHT"),$langs->transnoentitiesnoconv("Qty")).'</div>';
|
||||
$result = -1 ;
|
||||
}
|
||||
if (empty($_POST['idprod']) && $_POST["type"] < 0)
|
||||
{
|
||||
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Type")).'</div>';
|
||||
|
||||
@ -97,6 +97,7 @@ ErrorFailedToChangePassword=Failed to change password
|
||||
ErrorLoginDoesNotExists=User with login <b>%s</b> could not be found.
|
||||
ErrorLoginHasNoEmail=This user has no email address. Process aborted.
|
||||
ErrorBadValueForCode=Bad value for security code. Try again with new value...
|
||||
ErrorBothFieldCantBeNegative=Fields %s and %s can't be both negative
|
||||
|
||||
# Warnings
|
||||
WarningSafeModeOnCheckExecDir=Warning, PHP option <b>safe_mode</b> is on so command must be stored inside a directory declared by php parameter <b>safe_mode_exec_dir</b>.
|
||||
|
||||
@ -98,6 +98,7 @@ ErrorFailedToChangePassword=Échec de modification du mot de passe
|
||||
ErrorLoginDoesNotExists=Le compte utilisateur de login <b>%s</b> n'a pu être trouvé.
|
||||
ErrorLoginHasNoEmail=Cet utilisateur n'a pas d'email. Impossible de continuer.
|
||||
ErrorBadValueForCode=Mauvaise valeur saisie pour le code. Réessayez avec une nouvelle valeur...
|
||||
ErrorBothFieldCantBeNegative=Les champs %s et %s ne peuvent être tous deux négatifs
|
||||
|
||||
# Warnings
|
||||
WarningSafeModeOnCheckExecDir=Attention, l'option PHP <b>safe_mode</b> est active, la commande doit dont être dans un répertoire déclaré dans le paramètre php <b>safe_mode_exec_dir</b>.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user