Add password length limit if using the Blowfish hashing algorithm

- Add new page to reset a password that would be too long
- Add support for pattern parameter in field_password
This commit is contained in:
Hypolite Petovan 2022-08-01 11:42:10 -04:00
parent 067f06b166
commit 49394aedeb
8 changed files with 169 additions and 6 deletions

View file

@ -291,8 +291,14 @@ class Authentication
$this->dba->update('user', ['openid' => $openid_identity, 'openidserver' => $openid_server], ['uid' => $record['uid']]);
}
$this->setForUser($a, $record, true, true);
/**
* @see User::getPasswordRegExp()
*/
if (PASSWORD_DEFAULT === PASSWORD_BCRYPT && strlen($password) > 72) {
$return_path = '/security/password_too_long?' . http_build_query(['return_path' => $return_path]);
}
$this->setForUser($a, $record, true, true);
$this->baseUrl->redirect($return_path);
}