Fixed user name validation

This commit is contained in:
Marcin Kurczewski 2014-09-02 23:07:31 +02:00
parent 51c0fa2636
commit aed090da7d

View file

@ -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 (-).');
}