From 20e1209f96e9c0bca6a1a3db23f730329a8ea030 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Tue, 9 Dec 2003 15:07:19 +0000 Subject: [PATCH] bug 851564 --- ChangeLog | 2 ++ main.php | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 129c37747..0f2df79f3 100755 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,8 @@ $Source$ 2003-12-09 Marc Delisle * libraries/sqlparser.data.php: bug 854702: FORCE INDEX + * main.php: bug 851564: backquotes on the wildcard dbname + when no controluser is defined 2003-12-08 Garvin Hicking * tbl_change.php: Fixed Bug #856436 (not displaying default values) diff --git a/main.php b/main.php index bd942594f..20a5f2bd7 100644 --- a/main.php +++ b/main.php @@ -168,6 +168,8 @@ $is_superuser = FALSE; if ($server > 0) { // Get user's global privileges ($dbh and $userlink are links to MySQL // defined in the "common.lib.php" library) + // Note: if no controluser is defined, $dbh contains $userlink + $is_create_priv = FALSE; $is_process_priv = TRUE; $is_reload_priv = FALSE; @@ -197,7 +199,6 @@ if ($server > 0) { mysql_free_result($rs_usr); } // end if } // end if - // If the user has Create priv on a inexistant db, show him in the dialog // the first inexistant db name that we find, in most cases it's probably // the one he just dropped :) @@ -245,6 +246,8 @@ if ($server > 0) { else if (ereg($re0 . '%|_', $show_grants_dbname) || !PMA_mysql_select_db($show_grants_dbname, $userlink) && @mysql_errno() != 1044) { $db_to_create = ereg_replace($re0 . '%', '\\1...', ereg_replace($re0 . '_', '\\1?', $show_grants_dbname)); $db_to_create = ereg_replace($re1 . '(%|_)', '\\1\\3', $db_to_create); + // and remove backquotes + $db_to_create = str_replace('`','',$db_to_create); $is_create_priv = TRUE; break; } // end elseif