diff options
| author | Joas Schilling <nickvergessen@gmx.de> | 2011-10-17 23:22:36 +0200 |
|---|---|---|
| committer | Joas Schilling <nickvergessen@gmx.de> | 2011-11-13 15:40:18 +0100 |
| commit | 6370ef27057643ee7fe0a6fbf2341c2ebdb57d4c (patch) | |
| tree | 2e3996412d60d28a0f6b1581d7da32ea6628c7ff /phpBB/install/install_install.php | |
| parent | 86f8851c403bb9f31b43a9656e844e5c925da19a (diff) | |
| download | forums-6370ef27057643ee7fe0a6fbf2341c2ebdb57d4c.tar forums-6370ef27057643ee7fe0a6fbf2341c2ebdb57d4c.tar.gz forums-6370ef27057643ee7fe0a6fbf2341c2ebdb57d4c.tar.bz2 forums-6370ef27057643ee7fe0a6fbf2341c2ebdb57d4c.tar.xz forums-6370ef27057643ee7fe0a6fbf2341c2ebdb57d4c.zip | |
[ticket/9066] Disallow some database prefix to prevent same errors and problems
With this patch database prefixes must not be empty and only contain
alphanumeric characters, numbers and underscores.
PHPBB3-9066
Diffstat (limited to 'phpBB/install/install_install.php')
| -rw-r--r-- | phpBB/install/install_install.php | 7 |
1 files changed, 6 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', |
