From 3158d0897e7bb94285fbf95e4ab8d118ff5460dd Mon Sep 17 00:00:00 2001 From: David M Date: Mon, 16 Jul 2007 01:06:34 +0000 Subject: [PATCH] #13463 - tiny issue with get_tables() git-svn-id: file:///svn/phpbb/trunk@7893 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 2 ++ phpBB/includes/acp/acp_database.php | 6 +++--- phpBB/includes/functions_install.php | 1 + phpBB/install/install_convert.php | 1 + 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 24e0060bff..5df23ae7e8 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -247,6 +247,8 @@ p a {
  • [Fix] Explain that themes which need parsing cannot be stored on the filesystem (Bug #11134)
  • [Fix] Normalize usernames
  • [Change] Improved utf8_clean_string with a more complete list of homographs and NFKC normalization
  • +
  • [Fix] Fixed error messages that ACP Database can give (Bug #13463)
  • +
  • [Fix] Fixed potential issues with databases that use tables names is uppercase
  • diff --git a/phpBB/includes/acp/acp_database.php b/phpBB/includes/acp/acp_database.php index c967274a36..d8d4b8a306 100644 --- a/phpBB/includes/acp/acp_database.php +++ b/phpBB/includes/acp/acp_database.php @@ -48,7 +48,7 @@ class acp_database if (!sizeof($table)) { - trigger_error($user->lang['TABLE_SELECT_ERROR'] . adm_back_link($this->u_action)); + trigger_error($user->lang['TABLE_SELECT_ERROR'] . adm_back_link($this->u_action), E_USER_WARNING); } $store = $download = $structure = $schema_data = false; @@ -165,7 +165,7 @@ class acp_database $tables = get_tables($db); foreach ($tables as $table_name) { - if (strlen($table_prefix) === 0 || strpos($table_name, $table_prefix) === 0) + if (strlen($table_prefix) === 0 || stripos($table_name, $table_prefix) === 0) { $template->assign_block_vars('tables', array( 'TABLE' => $table_name @@ -343,7 +343,7 @@ class acp_database { if ($sub === false) { - trigger_error($user->lang['RESTORE_FAILURE'] . adm_back_link($this->u_action)); + trigger_error($user->lang['RESTORE_FAILURE'] . adm_back_link($this->u_action), E_USER_WARNING); } pg_put_line($db->db_connect_id, $sub . "\n"); } diff --git a/phpBB/includes/functions_install.php b/phpBB/includes/functions_install.php index 133ef294b0..8e4e36a63d 100644 --- a/phpBB/includes/functions_install.php +++ b/phpBB/includes/functions_install.php @@ -324,6 +324,7 @@ function connect_check_db($error_connect, &$error, $dbms, $table_prefix, $dbhost $table_ary = array($temp_prefix . 'attachments', $temp_prefix . 'config', $temp_prefix . 'sessions', $temp_prefix . 'topics', $temp_prefix . 'users'); $tables = get_tables($db); + $tables = array_map('strtolower', $tables); $table_intersect = array_intersect($tables, $table_ary); if (sizeof($table_intersect)) diff --git a/phpBB/install/install_convert.php b/phpBB/install/install_convert.php index 4d7055d763..0f2486d874 100644 --- a/phpBB/install/install_convert.php +++ b/phpBB/install/install_convert.php @@ -463,6 +463,7 @@ class install_convert extends module $prefixes = array(); $tables_existing = get_tables($src_db); + $tables_existing = array_map('strtolower', $tables_existing); foreach ($tables_existing as $table_name) { compare_table($tables, $table_name, $prefixes);