Skip to content

Commit

Permalink
Merge branch 'master' of github.com:phpmyadmin/phpmyadmin
Browse files Browse the repository at this point in the history
  • Loading branch information
madhuracj committed Nov 27, 2013
2 parents ca5494c + 20770f3 commit ab3fa5e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ phpMyAdmin - ChangeLog
- bug #4075 Support A10 Networks load balancer
- bug #4083 row deleting isn't binlogs friendly
- bug #4163 Setup script does not recognize manually-configured server
- bug #4158 Events page says no privileges with ALL PRIVILEGES

4.0.9.0 (2013-11-04)
- bug #4104 Can't edit updatable view when searching
Expand Down
10 changes: 9 additions & 1 deletion libraries/Util.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -3850,7 +3850,15 @@ public static function currentUserHasPrivilege($priv, $db = null, $tbl = null)
// (wildcard characters appear as being quoted with a backslash
// when querying TABLE_SCHEMA.SCHEMA_PRIVILEGES)
$db = str_replace(array('%', '_'), array('\%', '\_'), $db);
$query .= " AND TABLE_SCHEMA='%s'";
/*
* This is to take into account a wildcard db privilege
* so we replace % by .* and _ by . to be able to compare
* with REGEXP.
*
* Also, we need to double the inner % to please sprintf().
*/
$query .= " AND '%s' REGEXP"
. " REPLACE(REPLACE(TABLE_SCHEMA, '_', '.'), '%%', '.*')";
$schema_privileges = $GLOBALS['dbi']->fetchValue(
sprintf(
$query,
Expand Down

0 comments on commit ab3fa5e

Please sign in to comment.