diff options
author | Graham Eames <grahamje@users.sourceforge.net> | 2006-08-12 07:00:26 +0000 |
---|---|---|
committer | Graham Eames <grahamje@users.sourceforge.net> | 2006-08-12 07:00:26 +0000 |
commit | a4c580e8f8b33df98aee44aa2e66b88997310fe9 (patch) | |
tree | fd54fdfddb29c68afda15553119491c17364cee2 | |
parent | ca2a672d20f65d44cf9eb6114e89d273ba5deaef (diff) | |
download | forums-a4c580e8f8b33df98aee44aa2e66b88997310fe9.tar forums-a4c580e8f8b33df98aee44aa2e66b88997310fe9.tar.gz forums-a4c580e8f8b33df98aee44aa2e66b88997310fe9.tar.bz2 forums-a4c580e8f8b33df98aee44aa2e66b88997310fe9.tar.xz forums-a4c580e8f8b33df98aee44aa2e66b88997310fe9.zip |
Check the prefix length to ensure that the key names are within the maximum for that DBMS
git-svn-id: file:///svn/phpbb/trunk@6268 89ea8834-ac86-4346-8a33-228a782c2dd0
-rwxr-xr-x | phpBB/install/install_install.php | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php index 1ccf157677..55de7d4d2c 100755 --- a/phpBB/install/install_install.php +++ b/phpBB/install/install_install.php @@ -1299,6 +1299,10 @@ class install_install extends module { foreach ($row['cat'] as $cat_name) { + if (!isset($categories[$cat_name])) + { + continue; + } $module_data = array( 'module_basename' => $module_basename, 'module_enabled' => 1, @@ -1637,6 +1641,41 @@ class install_install extends module return false; } + // Check the prefix length to ensure that index names are not too long + switch ($dbms) + { + case 'mysql': + case 'mysql4': + case 'mysqli': + case 'postgres': + $prefix_length = 36; + + break; + + case 'mssql': + case 'mssql_odbc': + $prefix_length = 90; + + break; + + case 'oracle': + case 'sqlite': + $prefix_length = 200; + + break; + + case 'firebird': + $prefix_length = 6; + + break; + } + + if (strlen($table_prefix) > $prefix_length) + { + $error[] = sprintf($lang['INST_ERR_PREFIX_TOO_LONG'], $prefix_length); + return false; + } + // Try and connect ... if (is_array($db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false))) { |