]> git.mxchange.org Git - friendica.git/commitdiff
Add Exception when password is empty in User::hashPassword()
authorHypolite Petovan <mrpetovan@gmail.com>
Thu, 19 Apr 2018 02:49:14 +0000 (22:49 -0400)
committerHypolite Petovan <mrpetovan@gmail.com>
Thu, 19 Apr 2018 11:51:26 +0000 (07:51 -0400)
src/Model/User.php

index 2621897f4eb87084a97040bba458d7c8f1078560..41d26ee19d66f4c27d3b3a885f086564d9e466c0 100644 (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);
        }