Add Exception when password is empty in User::hashPassword()

2022.09-rc
Hypolite Petovan 2018-04-18 22:49:14 -04:00
rodzic b73d5a641f
commit 0496822ca3
1 zmienionych plików z 4 dodań i 0 usunięć

Wyświetl plik

@ -258,6 +258,10 @@ class User
*/
public static function hashPassword($password)
{
if (!trim($password)) {
throw new Exception(L10n::t('Password can\'t be empty'));
}
return password_hash($password, PASSWORD_DEFAULT);
}