diff options
| -rw-r--r-- | phpBB/install/install_install.php | 7 | ||||
| -rw-r--r-- | phpBB/language/en/install.php | 2 | 
2 files changed, 8 insertions, 1 deletions
| diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php index 9fe0c8aed5..bb1d858cfc 100644 --- a/phpBB/install/install_install.php +++ b/phpBB/install/install_install.php @@ -546,6 +546,11 @@ class install_install extends module  				$error[] = $lang['INST_ERR_NO_DB'];  				$connect_test = false;  			} +			else if (!preg_match('#^[a-zA-Z][a-zA-Z0-9_]*$#', $data['table_prefix'], $result)) +			{ +				$error[] = $lang['INST_ERR_DB_INVALID_PREFIX']; +				$connect_test = false; +			}  			else  			{  				$connect_test = connect_check_db(true, $error, $available_dbms[$data['dbms']], $data['table_prefix'], $data['dbhost'], $data['dbuser'], htmlspecialchars_decode($data['dbpasswd']), $data['dbname'], $data['dbport']); @@ -2032,7 +2037,7 @@ class install_install extends module  		'dbname'				=> array('lang' => 'DB_NAME',		'type' => 'text:25:100', 'explain' => false),  		'dbuser'				=> array('lang' => 'DB_USERNAME',	'type' => 'text:25:100', 'explain' => false),  		'dbpasswd'				=> array('lang' => 'DB_PASSWORD',	'type' => 'password:25:100', 'explain' => false), -		'table_prefix'			=> array('lang' => 'TABLE_PREFIX',	'type' => 'text:25:100', 'explain' => false), +		'table_prefix'			=> array('lang' => 'TABLE_PREFIX',	'type' => 'text:25:100', 'explain' => true),  	);  	var $admin_config_options = array(  		'legend1'				=> 'ADMIN_CONFIG', diff --git a/phpBB/language/en/install.php b/phpBB/language/en/install.php index befa7c6f40..f038177df4 100644 --- a/phpBB/language/en/install.php +++ b/phpBB/language/en/install.php @@ -232,6 +232,7 @@ $lang = array_merge($lang, array(  	'INST_ERR'					=> 'Installation error',  	'INST_ERR_DB_CONNECT'		=> 'Could not connect to the database, see error message below.',  	'INST_ERR_DB_FORUM_PATH'	=> 'The database file specified is within your board directory tree. You should put this file in a non web-accessible location.', +	'INST_ERR_DB_INVALID_PREFIX'=> 'The prefix you entered is invalid. It must start with an alphanumeric character and must only contain alphanumeric characters, numbers and underscores.',  	'INST_ERR_DB_NO_ERROR'		=> 'No error message given.',  	'INST_ERR_DB_NO_MYSQLI'		=> 'The version of MySQL installed on this machine is incompatible with the “MySQL with MySQLi Extension” option you have selected. Please try the “MySQL” option instead.',  	'INST_ERR_DB_NO_SQLITE'		=> 'The version of the SQLite extension you have installed is too old, it must be upgraded to at least 2.8.2.', @@ -352,6 +353,7 @@ $lang = array_merge($lang, array(  	'TABLES_MISSING'			=> 'Could not find these tables<br />» <strong>%s</strong>.',  	'TABLE_PREFIX'				=> 'Prefix for tables in database', +	'TABLE_PREFIX_EXPLAIN'		=> 'The prefix must start with an alphanumeric character and must only contain alphanumeric characters, numbers and underscores.',  	'TABLE_PREFIX_SAME'			=> 'The table prefix needs to be the one used by the software you are converting from.<br />» Specified table prefix was %s.',  	'TESTS_PASSED'				=> 'Tests passed',  	'TESTS_FAILED'				=> 'Tests failed', | 
