diff --git a/libraries/classes/Plugins/Auth/AuthenticationCookie.php b/libraries/classes/Plugins/Auth/AuthenticationCookie.php index 0a8000c948..f3f1e3a5a5 100644 --- a/libraries/classes/Plugins/Auth/AuthenticationCookie.php +++ b/libraries/classes/Plugins/Auth/AuthenticationCookie.php @@ -331,7 +331,13 @@ class AuthenticationCookie extends AuthenticationPlugin // The user just logged in $this->user = Core::sanitizeMySQLUser($_POST['pma_username']); - $this->password = $_POST['pma_password'] ?? ''; + + $password = $_POST['pma_password'] ?? ''; + if (strlen($password) > 256) { + $password = substr($password, 0, 256); + } + $this->password = $password; + if ($GLOBALS['cfg']['AllowArbitraryServer'] && isset($_REQUEST['pma_servername']) ) { diff --git a/libraries/common.inc.php b/libraries/common.inc.php index 06884a61a1..eba4e33809 100644 --- a/libraries/common.inc.php +++ b/libraries/common.inc.php @@ -264,10 +264,6 @@ if (! defined('PMA_MINIMUM_COMMON')) { } unset($cache_key); - if (isset($_POST['pma_password']) && strlen($_POST['pma_password']) > 256) { - $_POST['pma_password'] = substr($_POST['pma_password'], 0, 256); - } - $auth_plugin = Plugins::getAuthPlugin(); $auth_plugin->authenticate();