Move password truncation to AuthenticationCookie

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
This commit is contained in:
Maurício Meneghini Fauth 2020-07-24 22:36:45 -03:00
parent 65f6fc3c6e
commit 8c3536bce1
2 changed files with 7 additions and 5 deletions

View File

@ -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'])
) {

View File

@ -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();