diff --git a/ChangeLog b/ChangeLog index a885f70b40..2dd4698531 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,7 @@ phpMyAdmin - ChangeLog - bug #4545 trying to favorite table while browser localStorage is disabled throws JS error - bug #4259 reCaptcha sound session expired problem - bug #4548 Inline editing a field converts tab to spaces +- bug #4252 Database-level permission bug for db names containing underscores 4.2.9.0 (2014-09-20) - bug ajax.js responseHandler: cannot read property of null diff --git a/libraries/Util.class.php b/libraries/Util.class.php index 047232a3b9..8f96cc19c4 100644 --- a/libraries/Util.class.php +++ b/libraries/Util.class.php @@ -3833,19 +3833,7 @@ class PMA_Util // If a database name was provided and user does not have the // required global privilege, try database-wise permissions. if ($db !== null) { - // need to escape wildcards in db and table names, see bug #3566 - // (wildcard characters appear as being quoted with a backslash - // when querying TABLE_SCHEMA.SCHEMA_PRIVILEGES) - $db = str_replace(array('%', '_'), array('\%', '\_'), $db); - /* - * 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, '_', '.'), '%%', '.*')"; + $query .= " AND '%s' LIKE `TABLE_SCHEMA`"; $schema_privileges = $GLOBALS['dbi']->fetchValue( sprintf( $query,