From 1d8367368e1226514fcb69365fa1365de796cd7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maur=C3=ADcio=20Meneghini=20Fauth?= Date: Tue, 26 Mar 2024 16:08:42 -0300 Subject: [PATCH] Remove allowDeny_forbidden global MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes issue introduced by 2327dbf3c3c109b907ea478be098c77e80e1bf0b. Signed-off-by: MaurĂ­cio Meneghini Fauth --- .../classes/Plugins/Auth/AuthenticationConfig.php | 2 +- phpstan-baseline.neon | 14 ++------------ .../Plugins/Auth/AuthenticationConfigTest.php | 1 - .../Plugins/Auth/AuthenticationCookieTest.php | 1 - 4 files changed, 3 insertions(+), 15 deletions(-) diff --git a/libraries/classes/Plugins/Auth/AuthenticationConfig.php b/libraries/classes/Plugins/Auth/AuthenticationConfig.php index 6f814a7d70..443c6cf4f3 100644 --- a/libraries/classes/Plugins/Auth/AuthenticationConfig.php +++ b/libraries/classes/Plugins/Auth/AuthenticationConfig.php @@ -99,7 +99,7 @@ class AuthenticationConfig extends AuthenticationPlugin
'; - if (isset($GLOBALS['allowDeny_forbidden']) && $GLOBALS['allowDeny_forbidden']) { + if ($failure === 'allow-denied') { trigger_error(__('Access denied!'), E_USER_NOTICE); } else { // Check whether user has configured something diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index b34d41b182..801f447ec2 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -465,11 +465,6 @@ parameters: count: 1 path: libraries/classes/Config/FormDisplay.php - - - message: "#^Parameter \\#1 \\$path of method PhpMyAdmin\\\\Config\\\\ConfigFile\\:\\:set\\(\\) expects string, int\\|string given\\.$#" - count: 1 - path: libraries/classes/Config/FormDisplay.php - - message: "#^Parameter \\#1 \\$string of static method PhpMyAdmin\\\\Sanitize\\:\\:escapeJsString\\(\\) expects string, mixed given\\.$#" count: 2 @@ -1316,7 +1311,7 @@ parameters: path: libraries/classes/Controllers/Import/ImportController.php - - message: "#^Parameter \\#2 \\$replace of function preg_replace expects array\\|string, float\\|int\\|string\\|string given\\.$#" + message: "#^Parameter \\#2 \\$replace of function preg_replace expects array\\|string, float\\|int\\|string given\\.$#" count: 1 path: libraries/classes/Controllers/Import/ImportController.php @@ -1550,11 +1545,6 @@ parameters: count: 1 path: libraries/classes/Controllers/Table/RelationController.php - - - message: "#^Parameter \\#2 \\$callback of function uksort expects callable\\(int\\|string, int\\|string\\)\\: int, 'strnatcasecmp' given\\.$#" - count: 1 - path: libraries/classes/Controllers/Table/RelationController.php - - message: "#^Parameter \\#2 \\$callback of function usort expects callable\\(string\\|null, string\\|null\\)\\: int, 'strnatcasecmp' given\\.$#" count: 1 @@ -2937,7 +2927,7 @@ parameters: - message: "#^Method PhpMyAdmin\\\\Dbal\\\\MysqliResult\\:\\:fetchAllKeyPair\\(\\) should return array\\ but returns array\\\\.$#" - count: 2 + count: 1 path: libraries/classes/Dbal/MysqliResult.php - diff --git a/test/classes/Plugins/Auth/AuthenticationConfigTest.php b/test/classes/Plugins/Auth/AuthenticationConfigTest.php index 9c55499836..e52e9f22f0 100644 --- a/test/classes/Plugins/Auth/AuthenticationConfigTest.php +++ b/test/classes/Plugins/Auth/AuthenticationConfigTest.php @@ -76,7 +76,6 @@ class AuthenticationConfigTest extends AbstractTestCase { $GLOBALS['errorHandler'] = new ErrorHandler(); $GLOBALS['cfg']['Servers'] = [1]; - $GLOBALS['allowDeny_forbidden'] = false; $dbi = $this->getMockBuilder(DatabaseInterface::class) ->disableOriginalConstructor() diff --git a/test/classes/Plugins/Auth/AuthenticationCookieTest.php b/test/classes/Plugins/Auth/AuthenticationCookieTest.php index 034138a9cd..cd578a8a56 100644 --- a/test/classes/Plugins/Auth/AuthenticationCookieTest.php +++ b/test/classes/Plugins/Auth/AuthenticationCookieTest.php @@ -823,7 +823,6 @@ class AuthenticationCookieTest extends AbstractNetworkTestCase $GLOBALS['server'] = 2; $_COOKIE['pmaAuth-2'] = 'pass'; - $GLOBALS['allowDeny_forbidden'] = ''; $GLOBALS['cfg']['LoginCookieValidity'] = 10; $this->mockResponse(