Browse Source

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

pull/4863/head
Hypolite Petovan 3 years ago
parent
commit
0496822ca3
  1. 4
      src/Model/User.php

4
src/Model/User.php

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

Loading…
Cancel
Save