diff --git a/ChangeLog b/ChangeLog index 2dc47051c7..15c9cdfded 100644 --- a/ChangeLog +++ b/ChangeLog @@ -34,6 +34,7 @@ phpMyAdmin - ChangeLog - issue #16982 Do not try to delete internal relations if they are not configured - issue #16982 Show success messages on Designer for add and remove relation operations - issue Fixed possible "Undefined index: clause_is_unique" on replace value in cell +- issue #16991 Fixed case where $_SERVER['REQUEST_METHOD'] is undefined 5.1.1 (2021-06-04) - issue #13325 Fixed created procedure shows up in triggers and events and vice-versa diff --git a/libraries/classes/Controllers/LogoutController.php b/libraries/classes/Controllers/LogoutController.php index 7794b1d9d9..a814cf62d9 100644 --- a/libraries/classes/Controllers/LogoutController.php +++ b/libraries/classes/Controllers/LogoutController.php @@ -12,7 +12,7 @@ class LogoutController { global $auth_plugin, $token_mismatch; - if ($_SERVER['REQUEST_METHOD'] !== 'POST' || $token_mismatch) { + if (($_SERVER['REQUEST_METHOD'] ?? 'GET') !== 'POST' || $token_mismatch) { Core::sendHeaderLocation('./index.php?route=/'); return; diff --git a/libraries/classes/Core.php b/libraries/classes/Core.php index bc98a43dd4..83ee4e5e6c 100644 --- a/libraries/classes/Core.php +++ b/libraries/classes/Core.php @@ -1393,7 +1393,7 @@ class Core $token_mismatch = true; $token_provided = false; - if ($_SERVER['REQUEST_METHOD'] !== 'POST') { + if (($_SERVER['REQUEST_METHOD'] ?? 'GET') !== 'POST') { return; } diff --git a/setup/index.php b/setup/index.php index 76e0941db2..8439b1159c 100644 --- a/setup/index.php +++ b/setup/index.php @@ -56,7 +56,7 @@ if ($page === 'config') { if ($page === 'servers') { $controller = new ServersController($GLOBALS['ConfigFile'], new Template()); - if (isset($_GET['mode']) && $_GET['mode'] === 'remove' && $_SERVER['REQUEST_METHOD'] === 'POST') { + if (isset($_GET['mode']) && $_GET['mode'] === 'remove' && ($_SERVER['REQUEST_METHOD'] ?? 'GET') === 'POST') { $controller->destroy([ 'id' => $_GET['id'] ?? null, ]);