瀏覽代碼

minimum password length

tags/0.1.0
Robin Thoni 8 年之前
父節點
當前提交
846da975c1
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3
    0
      src/Auth/Business/LuticateUsersBusiness.php

+ 3
- 0
src/Auth/Business/LuticateUsersBusiness.php 查看文件

@@ -132,6 +132,9 @@ class LuticateUsersBusiness extends LuBusiness {
132 132
 
133 133
     public static function add($username, $email, $firstname, $lastname, $password)
134 134
     {
135
+        if (strlen($password) < 5) {
136
+            self::badInput("Password must have at least 5 characters");
137
+        }
135 138
         $hash = self::hashPassword($password);
136 139
         if (filter_var($username, FILTER_VALIDATE_EMAIL))
137 140
             self::badInput("Username can not be an email");

Loading…
取消
儲存