Require numbers OR special chars for passwords, not AND

This commit is contained in:
Joshua Ramon Enslin 2022-03-09 00:16:55 +01:00
parent e18b649250
commit 589161219f
Signed by: jrenslin
GPG Key ID: 46016F84501B70AE

View File

@ -244,11 +244,8 @@ final class MD_STD_IN {
$errors[] = 'password_too_short';
}
if ((\preg_match('@[0-9]@', $input)) === false) {
$errors[] = 'password_has_no_number';
}
if ((\preg_match('@[^\w]@', $input)) === false) {
$errors[] = 'password_has_no_special_char';
if (!(\preg_match('@[0-9]@', $input)) && !(\preg_match('@[^\w]@', $input))) {
$errors[] = 'password_has_no_number_no_special_char';
}
return $errors;