diff --git a/ChangeLog b/ChangeLog index 4606d929a..987c7a030 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,10 @@ phpMyAdmin - ChangeLog $Id$ $Source$ +2006-05-14 Michal Čihař + * libraries/common.lib.php: Fix reading database list with MySQL wildcards + (bug #1487613). + 2006-05-14 Marc Delisle * libraries/import.lib.php: bug #1482841, support USE statement in the import file diff --git a/libraries/common.lib.php b/libraries/common.lib.php index 181994632..8c94fab83 100644 --- a/libraries/common.lib.php +++ b/libraries/common.lib.php @@ -3207,14 +3207,14 @@ if (! defined('PMA_MINIMUM_COMMON')) { // We don't want more than one asterisk inside our 'only_db'. continue; } - if ($is_show_dbs && ereg('(^|[^\])(_|%)', $dblist[$i])) { + if ($is_show_dbs && preg_match('/(^|[^\\\\])(_|%)/', $dblist[$i])) { $local_query = 'SHOW DATABASES LIKE \'' . $dblist[$i] . '\''; // here, a PMA_DBI_query() could fail silently // if SHOW DATABASES is disabled - $rs = PMA_DBI_try_query($local_query, $controllink); + $rs = PMA_DBI_try_query($local_query, $userlink); if ($i == 0 && ! $rs) { - $error_code = substr(PMA_DBI_getError($controllink), 1, 4); + $error_code = substr(PMA_DBI_getError($userlink), 1, 4); if ($error_code == 1227 || $error_code == 1045) { // "SHOW DATABASES" statement is disabled or not allowed to user $true_dblist[] = str_replace('\\_', '_', str_replace('\\%', '%', $dblist[$i]));