fix: [password validation] don't accept linebreaks
- as reported by cert.skpull/34/head
parent
7e504fbf11
commit
9e05e667ec
|
@ -38,7 +38,7 @@ class UsersTable extends AppTable
|
|||
->add('password', [
|
||||
'password_complexity' => [
|
||||
'rule' => function($value, $context) {
|
||||
if (!preg_match('/^((?=.*\d)|(?=.*\W+))(?![\n])(?=.*[A-Z])(?=.*[a-z]).*$|.{16,}/', $value) || strlen($value) < 12) {
|
||||
if (!preg_match('/^((?=.*\d)|(?=.*\W+))(?![\n])(?=.*[A-Z])(?=.*[a-z]).*$|.{16,}/s', $value) || strlen($value) < 12) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
Loading…
Reference in New Issue