diff options
Diffstat (limited to 'phpBB')
-rw-r--r-- | phpBB/includes/functions.php | 4 | ||||
-rw-r--r-- | phpBB/install/install_install.php | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index c2b099d48a..e477b0454e 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -3486,6 +3486,10 @@ function get_preg_expression($mode) $inline = ($mode == 'relative_url') ? ')' : ''; return "(?:[a-z0-9\-._~!$&'($inline*+,;=:@|]+|%[\dA-F]{2})*(?:/(?:[a-z0-9\-._~!$&'($inline*+,;=:@|]+|%[\dA-F]{2})*)*(?:\?(?:[a-z0-9\-._~!$&'($inline*+,;=:@/?|]+|%[\dA-F]{2})*)?(?:\#(?:[a-z0-9\-._~!$&'($inline*+,;=:@/?|]+|%[\dA-F]{2})*)?"; break; + + case 'table_prefix': + return '#^[a-zA-Z][a-zA-Z0-9_]*$#'; + break; } return ''; diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php index bb1d858cfc..ccdcf211f1 100644 --- a/phpBB/install/install_install.php +++ b/phpBB/install/install_install.php @@ -546,7 +546,7 @@ 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)) + else if (!preg_match(get_preg_expression('table_prefix'), $data['table_prefix'])) { $error[] = $lang['INST_ERR_DB_INVALID_PREFIX']; $connect_test = false; |