fix: [password validation] don't accept linebreaks

- as reported by cert.sk
pull/34/head
iglocska 2020-11-20 11:16:57 +01:00
parent 7e504fbf11
commit 9e05e667ec
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
1 changed files with 1 additions and 1 deletions

View File

@ -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;