From 6073705dde343b726e6727392534149b50ef9511 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 24 Nov 2011 08:58:52 +0100 Subject: [PATCH] Fix: check prefix validity --- htdocs/install/etape1.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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