--- fenglin/lib/passwd.inc.php 2025/03/30 13:11:54 1.1 +++ fenglin/lib/passwd.inc.php 2025/04/23 05:13:57 1.4 @@ -1,57 +1,42 @@ -= 3) - { - return false; - } - } - else - { - $ch[$c] = 1; - } - + $c = $password[$i]; + if (is_numeric($c)) { $num_count++; - if ($num_count >= 3) - { - return false; - } } - if (ord($c) >= ord('A') && ord($c) <= ord('Z')) + if (ctype_upper($c)) { $upper_case++; } - if (ord($c) >= ord('a') && ord($c) <= ord('z')) + if (ctype_lower($c)) { $lower_case++; } } - if ($upper_case==0 || $lower_case==0 || $num_count==0) + if ($upper_case == 0 || $lower_case == 0 || $num_count == 0) { return false; }