From eb4a89174e4695ec6bd1b759c3c75b14c50e6d5b Mon Sep 17 00:00:00 2001 From: ErickSkrauch Date: Fri, 4 Nov 2016 19:38:50 +0300 Subject: [PATCH] =?UTF-8?q?=3F=20=D1=82=D0=BE=D0=B6=D0=B5=20=D0=B1=D0=BE?= =?UTF-8?q?=D0=BB=D1=8C=D1=88=D0=B5=20=D0=BD=D0=B5=D0=BB=D1=8C=D0=B7=D1=8F?= =?UTF-8?q?=20=D0=B8=D1=81=D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D0=BE=D0=B2=D0=B0?= =?UTF-8?q?=D1=82=D1=8C,=20=D1=82.=D0=BA.=20=D0=BE=D0=BD=D0=B8=20=D1=82?= =?UTF-8?q?=D0=B0=D0=BA=20=D0=B6=D0=B5=20=D0=BD=D0=B5=20=D1=8D=D0=BA=D1=80?= =?UTF-8?q?=D0=B0=D0=BD=D0=B8=D1=80=D1=83=D1=8E=D1=82=D1=81=D1=8F=20=D0=BC?= =?UTF-8?q?=D0=B0=D0=B9=D0=BD=D0=BA=D1=80=D0=B0=D1=84=D1=82=D0=BE=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/validators/UsernameValidator.php | 2 +- .../common/unit/validators/UsernameValidatorTest.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/common/validators/UsernameValidator.php b/common/validators/UsernameValidator.php index 11a8a0c..7f5b76d 100644 --- a/common/validators/UsernameValidator.php +++ b/common/validators/UsernameValidator.php @@ -30,7 +30,7 @@ class UsernameValidator extends Validator { $length->tooShort = E::USERNAME_TOO_SHORT; $length->tooLong = E::USERNAME_TOO_LONG; - $pattern = new validators\RegularExpressionValidator(['pattern' => '/^[\p{L}\d-_\.!?$%^&*()\[\]:;]+$/u']); + $pattern = new validators\RegularExpressionValidator(['pattern' => '/^[\p{L}\d-_\.!$%^&*()\[\]:;]+$/u']); $pattern->message = E::USERNAME_INVALID; $unique = new validators\UniqueValidator(); diff --git a/tests/codeception/common/unit/validators/UsernameValidatorTest.php b/tests/codeception/common/unit/validators/UsernameValidatorTest.php index 8ef0600..34ed86e 100644 --- a/tests/codeception/common/unit/validators/UsernameValidatorTest.php +++ b/tests/codeception/common/unit/validators/UsernameValidatorTest.php @@ -45,7 +45,7 @@ class UsernameValidatorTest extends TestCase { public function testValidateAttributePattern() { $shouldBeValid = [ - 'русский_ник', 'русский_ник_на_грани!', 'numbers1132', '*__*-Stars-*__*', '1-_.!?$%^&*()[]', + 'русский_ник', 'русский_ник_на_грани!', 'numbers1132', '*__*-Stars-*__*', '1-_.!$%^&*()[]', '[ESP]Эрик', 'Свят_помидор;', 'зроблена_ў_беларусі:)', ]; foreach($shouldBeValid as $nickname) { @@ -55,7 +55,7 @@ class UsernameValidatorTest extends TestCase { } $shouldBeInvalid = [ - 'nick@name', 'spaced nick', 'im#hashed' + 'nick@name', 'spaced nick', 'im#hashed', 'quest?ion' ]; foreach($shouldBeInvalid as $nickname) { $model = $this->createModel($nickname);