From 6c002b9fbc088f4d0d2172d5407836321b16312e Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Mon, 26 Oct 2015 16:55:30 +1100 Subject: [PATCH] Fix #11594 'only_db' config option bug when db names contain underscore and are grouped Signed-off-by: Madhura Jayaratne --- ChangeLog | 1 + libraries/navigation/Nodes/Node.class.php | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 024cf536f7..3c764923d6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,7 @@ phpMyAdmin - ChangeLog - issue #11592 Missing headers in zipped export - issue #11590 Parser: Array to string conversion - issue #11597 Huge binary log growth on 4.5.x +- issue #11594 'only_db' config option bug when db names contain underscore and are grouped 4.5.1.0 (2015-10-23) - issue Invalid argument supplied for foreach() diff --git a/libraries/navigation/Nodes/Node.class.php b/libraries/navigation/Nodes/Node.class.php index 849901566a..546759744d 100644 --- a/libraries/navigation/Nodes/Node.class.php +++ b/libraries/navigation/Nodes/Node.class.php @@ -451,7 +451,8 @@ class Node $query .= "ORDER BY DB_first_level ASC "; $query .= "LIMIT $pos, $maxItems"; $query .= ") t2 "; - $query .= "WHERE 1 = LOCATE(CONCAT(DB_first_level, "; + $query .= $this->_getWhereClause('SCHEMA_NAME', $searchClause); + $query .= " AND 1 = LOCATE(CONCAT(DB_first_level, "; $query .= "'$dbSeparator'), "; $query .= "CONCAT(SCHEMA_NAME, "; $query .= "'$dbSeparator')) "; @@ -482,7 +483,7 @@ class Node } $query = "SHOW DATABASES "; - $query .= $this->_getWhereClause('Database', ''); + $query .= $this->_getWhereClause('Database', $searchClause); $query .= " AND ("; $subClauses = array(); foreach ($prefixes as $prefix) {