Browse Source

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

pull/4863/head
Hypolite Petovan 3 years ago
parent
commit
0496822ca3
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      src/Model/User.php

+ 4
- 0
src/Model/User.php View File

@ -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