From: Hypolite Petovan Date: Thu, 19 Apr 2018 02:49:14 +0000 (-0400) Subject: Add Exception when password is empty in User::hashPassword() X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=0496822ca3c929218f6fad23a35709d4ef26dcae;p=friendica.git Add Exception when password is empty in User::hashPassword() --- 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); }