diff options
author | William Desportes <williamdes@wdes.fr> | 2018-05-01 19:26:17 +0300 |
---|---|---|
committer | Michal Čihař <michal@cihar.com> | 2018-05-02 13:13:49 +0300 |
commit | 8af0343bb288784e4c5bef91a2d84c1df5b97d94 (patch) | |
tree | 318a36851cbe5b4bb91b226fe93ba110959e5a77 | |
parent | f5524eaa6c5be9b61fe19a6a1b6777ee73d8cbc6 (diff) |
Patch for issue #14246
Signed-off-by: William Desportes <williamdes@wdes.fr>
Signed-off-by: Michal Čihař <michal@cihar.com>
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | libraries/classes/DatabaseInterface.php | 5 | ||||
-rw-r--r-- | test/classes/DatabaseInterfaceTest.php | 14 |
3 files changed, 20 insertions, 0 deletions
@@ -7,6 +7,7 @@ phpMyAdmin - ChangeLog - issue #14029 Revert "Browse" table CSS overflow - issue #14241 Dropping indexes and foreign keys fail - issue #14227 Relational linking broken +- issue #14246 Fixed error in configuration storage zero config 4.8.0.1 (2018-04-19) - issue [security] Multiple CSRF vulnerabilities, See PMASA-2018-02 diff --git a/libraries/classes/DatabaseInterface.php b/libraries/classes/DatabaseInterface.php index 577a98a618..36695978ba 100644 --- a/libraries/classes/DatabaseInterface.php +++ b/libraries/classes/DatabaseInterface.php @@ -1533,6 +1533,11 @@ class DatabaseInterface { // If Zero configuration mode enabled, check PMA tables in current db. if ($GLOBALS['cfg']['ZeroConf'] == true) { + /** + * the DatabaseList class as a stub for the ListDatabase class + */ + $GLOBALS['dblist'] = new DatabaseList(); + if (strlen($GLOBALS['db'])) { $cfgRelation = $this->relation->getRelationsParam(); if (empty($cfgRelation['db'])) { diff --git a/test/classes/DatabaseInterfaceTest.php b/test/classes/DatabaseInterfaceTest.php index 134b431cd0..d0648a2c4e 100644 --- a/test/classes/DatabaseInterfaceTest.php +++ b/test/classes/DatabaseInterfaceTest.php @@ -150,6 +150,20 @@ class DatabaseInterfaceTest extends PmaTestCase } /** + * Tests for DBI::postConnectControl() method. + * + * @return void + * @test + */ + public function testPostConnectControl() + { + $GLOBALS['db'] = ''; + $GLOBALS['cfg']['Server']['only_db'] = array(); + $this->_dbi->postConnectControl(); + $this->assertInstanceOf('PhpMyAdmin\Database\DatabaseList', $GLOBALS['dblist']); + } + + /** * Test for getDbCollation * * @return void |