From 2f55324005bea969f62c1a0c291ca42ab4317f7e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 7 Jun 2011 17:55:13 +0000 Subject: [PATCH] Sec: More sanity check on parameters --- htdocs/install/etape0.php | 6 +++++- htdocs/langs/en_US/errors.lang | 1 + htdocs/langs/fr_FR/errors.lang | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/htdocs/install/etape0.php b/htdocs/install/etape0.php index 1bb76a2c42a..b354b1486a2 100644 --- a/htdocs/install/etape0.php +++ b/htdocs/install/etape0.php @@ -100,7 +100,11 @@ if (empty($_POST["db_user"])) print '
'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Login")).'
'; $error++; } - +if (! empty($_POST["db_port"]) && ! is_numeric($_POST["db_port"])) +{ + print '
'.$langs->trans("ErrorBadValueForParameter",$_POST["db_port"],$langs->transnoentities("Port")).'
'; + $error++; +} /** * Tentative de connexion a la base diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index 9ba8b66c18b..99394dcfe81 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -28,6 +28,7 @@ ErrorBadSupplierCodeSyntax=Bad syntax for supplier code ErrorSupplierCodeRequired=Supplier code required ErrorSupplierCodeAlreadyUsed=Supplier code already used ErrorBadParameters=Bad parameters +ErrorBadValueForParameter=Wrong value '%s' for parameter incorrect '%s' ErrorFailedToWriteInDir=Failed to write in directory %s ErrorFoundBadEmailInFile=Found incorrect email syntax for %s lines in file (example line %s with email=%s) ErrorUserCannotBeDelete=User can not be deleted. May be it is associated on Dolibarr entities. diff --git a/htdocs/langs/fr_FR/errors.lang b/htdocs/langs/fr_FR/errors.lang index 5e4823b8d1a..5eb50fdd0f0 100644 --- a/htdocs/langs/fr_FR/errors.lang +++ b/htdocs/langs/fr_FR/errors.lang @@ -29,6 +29,7 @@ ErrorBadSupplierCodeSyntax=La syntaxe du code fournisseur est incorrecte ErrorSupplierCodeRequired=Code fournisseur obligatoire ErrorSupplierCodeAlreadyUsed=Code fournisseur déjà utilisé ErrorBadParameters=Paramètres incorrects +ErrorBadValueForParameter=Valeur '%s' incorrecte pour le paramètre '%s' ErrorFailedToWriteInDir=Impossible d'écrire dans le répertoire %s ErrorFoundBadEmailInFile=Syntaxe de mail incorrecte trouvée pour %s lignes dans le fichier (exemple ligne %s avec email=%s) ErrorUserCannotBeDelete=L'utilisateur ne peut pas être supprimé. Peut-être est-il associé à des éléments de Dolibarr.