diff --git a/src/Model/User.php b/src/Model/User.php index 2621897f4e..41d26ee19d 100644 --- a/src/Model/User.php +++ b/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); }