diff --git a/htdocs/install/etape1.php b/htdocs/install/etape1.php
index fe3278fb81d..ebfea90aa06 100644
--- a/htdocs/install/etape1.php
+++ b/htdocs/install/etape1.php
@@ -84,11 +84,6 @@ if (empty($_POST["db_name"]))
print '
'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("DatabaseName")).'
';
$error++;
}
-if (empty($_POST["db_prefix"]))
-{
- print ''.$langs->trans("ErrorFieldRequired",$langs->transnoentities("DatabasePrefix")).'
';
- $error++;
-}
if (empty($_POST["db_user"]))
{
print ''.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Login")).'
';
@@ -99,6 +94,11 @@ if (! empty($_POST["db_port"]) && ! is_numeric($_POST["db_port"]))
print ''.$langs->trans("ErrorBadValueForParameter",$_POST["db_port"],$langs->transnoentities("Port")).'
';
$error++;
}
+if (! empty($_POST["db_prefix"]) && ! preg_match('/^[a-z0-9]+_$/i', $_POST["db_prefix"]))
+{
+ print ''.$langs->trans("ErrorBadValueForParameter",$_POST["db_prefix"],$langs->transnoentities("DatabasePrefix")).'
';
+ $error++;
+}
// Remove last / into dans main_dir