We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 47df997 commit c838aa3Copy full SHA for c838aa3
src/Ltb/Ppolicy.php
@@ -51,8 +51,10 @@ static function check_password_strength( $password,
51
52
$forbidden = 0;
53
if ( isset($pwd_forbidden_chars) && !empty($pwd_forbidden_chars) ) {
54
- preg_match_all("/[$pwd_forbidden_chars]/", $password, $forbidden_res);
55
- $forbidden = count( $forbidden_res[0] );
+ $escaped = preg_quote($pwd_forbidden_chars, '/');
+ $pattern = '/[' . $escaped . ']/u';
56
+ preg_match_all($pattern, $password, $forbidden_res);
57
+ $forbidden = isset($forbidden_res[0]) ? count($forbidden_res[0]) : 0;
58
}
59
60
# Complexity: checks for lower, upper, special, digits
0 commit comments