Fix reading database list with MySQL wildcards (bug #1487613).

This commit is contained in:
Michal Čihař
2006-05-14 16:40:54 +00:00
parent 1b5d1212dd
commit 22128e5f89
2 changed files with 7 additions and 3 deletions

View File

@@ -5,6 +5,10 @@ phpMyAdmin - ChangeLog
$Id$
$Source$
2006-05-14 Michal Čihař <michal@cihar.com>
* libraries/common.lib.php: Fix reading database list with MySQL wildcards
(bug #1487613).
2006-05-14 Marc Delisle <lem9@users.sourceforge.net>
* libraries/import.lib.php: bug #1482841, support USE statement in the import file

View File

@@ -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]));