add check for non alpa/-/_ chars

This commit is contained in:
typ 2013-07-13 16:41:51 +02:00
parent b64ef5a489
commit 0775eaf8c1

View File

@ -455,6 +455,10 @@ class User {
$this->setErrorMessage('Username exceeding character limit');
return false;
}
if (!preg_match('/[^a-zA-Z0-9_\-]/', $username)) {
$this->setErrorMessage('Username may only contain alphanumeric characters');
return false;
}
if ($this->getEmail($email1)) {
$this->setErrorMessage( 'This e-mail address is already taken' );
return false;