From 0496822ca3c929218f6fad23a35709d4ef26dcae Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Wed, 18 Apr 2018 22:49:14 -0400 Subject: [PATCH] Add Exception when password is empty in User::hashPassword() --- src/Model/User.php | 4 ++++ 1 file changed, 4 insertions(+) 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); }