From 6535ad6d3e2b4751a913be7394308a8402c9700f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Chapeaux?= Date: Sat, 13 Apr 2002 16:14:02 +0000 Subject: [PATCH] Fixed an other bug with escaped wildcards in dbs name --- ChangeLog | 6 +++--- user_details.php3 | 7 +++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1a22ff016..536b6416c 100755 --- a/ChangeLog +++ b/ChangeLog @@ -7,9 +7,9 @@ $Source$ 2002-04-13 Loïc Chapeaux * lang/korean.inc.php3: fixed some inconcistencies. - * main.php3, lines 200-201; user_details.php3, line 82: fixed a bug with - privileges when applied to database name containing an escaped wilcard - character (then used a litteral charcter). Thanks to + * main.php3, lines 200-201; user_details.php3, line 82 & 1339-1344: fixed + bugs with privileges when applied to database name containing an escaped + wilcard character (then used a litteral charcter). Thanks to Mike Eheler . * tbl_alter.php3, lines 109-112: fixed bug #543365 - Can't change field properties when name contains localized characters. diff --git a/user_details.php3 b/user_details.php3 index fa46aa38b..30c7cb221 100644 --- a/user_details.php3 +++ b/user_details.php3 @@ -1336,6 +1336,13 @@ else if (isset($grants) && $grants) { } } } // end if + + // Escape wilcard characters if required + if (isset($dbgrant) && !$anydb && !$newdb) { + $re = '(^|(\\\\\\\\)+|[^\])(_|%)'; // non-escaped wildcards + $dbgrant = ereg_replace($re, '\\\\3', $dbgrant); + } + if (!$newdb) { $sql_query .= ' ON ' . (($anydb || $dbgrant == '') ? '*' : PMA_backquote($dbgrant))