Add Exception when password is empty in User::hashPassword()
This commit is contained in:
parent
b73d5a641f
commit
0496822ca3
1 changed files with 4 additions and 0 deletions
|
@ -258,6 +258,10 @@ class User
|
||||||
*/
|
*/
|
||||||
public static function hashPassword($password)
|
public static function hashPassword($password)
|
||||||
{
|
{
|
||||||
|
if (!trim($password)) {
|
||||||
|
throw new Exception(L10n::t('Password can\'t be empty'));
|
||||||
|
}
|
||||||
|
|
||||||
return password_hash($password, PASSWORD_DEFAULT);
|
return password_hash($password, PASSWORD_DEFAULT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue