From aed090da7d7b9e213b8935b3c1c6d943538dbfed Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Tue, 2 Sep 2014 23:07:31 +0200 Subject: [PATCH] Fixed user name validation --- src/Validator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Validator.php b/src/Validator.php index 8d202867..32dc006b 100644 --- a/src/Validator.php +++ b/src/Validator.php @@ -43,7 +43,7 @@ class Validator $this->validateNonEmpty($userName, 'User name'); $this->validateLength($userName, $minUserNameLength, $maxUserNameLength, 'User name'); - if (preg_match('/[^a-zA-Z_-]/', $userName)) + if (preg_match('/[^a-zA-Z0-9_-]/', $userName)) { throw new \DomainException('User name may contain only characters, numbers, underscore (_) and dash (-).'); }