diff --git a/ChangeLog b/ChangeLog index b027892c1..765aa9d94 100755 --- a/ChangeLog +++ b/ChangeLog @@ -4,20 +4,26 @@ phpMyAdmin - Changelog $Id$ $Source$ + +2002-07-12 Alexander M. Turek + * main.php3: Fixed a bug of the SHOW GRANTS patch (bug #568174: Wildcards + escaped in db name), thanks to Björn T. Hallberg (bth). + 2002-07-12 Mike Beck - * sql.php3: only run query if we didn't ask for phpcode of sql + * sql.php3: only run query if we didn't ask for phpcode of sql. + 2002-07-12 Marc Delisle - * libraries/select_lang.lib.php3: add -utf-8 choices - * lang/indonesian updates, thanks to Rachim Tamsjadi + * libraries/select_lang.lib.php3: add -utf-8 choices. + * lang/indonesian updates, thanks to Rachim Tamsjadi. * libraries/relation.lib.php3: better initialization for a variable, - thanks to Jurgen Schwietering (jurgen at schwietering.com) + thanks to Jurgen Schwietering . 2002-07-11 Loïc Chapeaux - * pdf_schema.php3; tbl_printview.php3; tbl_properties_links.php3; - tbl_properties_operations.php3; tbl_relation.php3; - libraries/charset_conversion.lib.php3; libraries/display_tbl.lib.php3; - libraries/relation.lib.php3: coding standards. - * libraries/common.lib.php3: coding standards and a little display bug. + * pdf_schema.php3; tbl_printview.php3; tbl_properties_links.php3; + tbl_properties_operations.php3; tbl_relation.php3; + libraries/charset_conversion.lib.php3; libraries/display_tbl.lib.php3; + libraries/relation.lib.php3: coding standards. + * libraries/common.lib.php3: coding standards and a little display bug. 2002-07-11 Alexander M. Turek * libraries/common.lib.php3: PHP3 compatibility. diff --git a/main.php3 b/main.php3 index cbc1ddec6..d4d53ff86 100755 --- a/main.php3 +++ b/main.php3 @@ -219,7 +219,8 @@ if ($server > 0) { $rs_usr = PMA_mysql_query($local_query, $dbh); } if ($rs_usr) { - $re = '(^|(\\\\\\\\)+|[^\])'; + $re0 = '(^|(\\\\\\\\)+|[^\])'; // non-escaped wildcards + $re1 = '(^|[^\])(\\\)+'; // escaped wildcards while ($row = PMA_mysql_fetch_row($rs_usr)) { $show_grants_dbname = substr($row[0], strpos($row[0], ' ON ') + 4,(strpos($row[0], '.', strpos($row[0], ' ON ')) - strpos($row[0], ' ON ') - 4)); $show_grants_str = substr($row[0],6,(strpos($row[0],' ON ')-6)); @@ -230,8 +231,8 @@ if ($server > 0) { break; } // end if else if (ereg($re . '%|_', $show_grants_dbname) || !PMA_mysql_select_db($show_grants_dbname, $userlink) && @mysql_errno() != 1044) { - $show_grants_dbname = ereg_replace($re . '%', '\\1...', ereg_replace($re . '_', '\\1?', $show_grants_dbname)); - $db_to_create = $show_grants_dbname; + $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); $is_create_priv = TRUE; break; } // end elseif