fix user nick validation, fixes #369

This commit is contained in:
msquare 2017-12-01 19:03:15 +01:00
parent a5f5dc52c8
commit 0f273988c9
1 changed files with 3 additions and 3 deletions

View File

@ -266,14 +266,14 @@ function User_ids()
} }
/** /**
* Strip unwanted characters from a users nick. * Strip unwanted characters from a users nick. Allowed are letters, numbers, connecting punctuation and simple space.
* * Nick is trimmed.
* @param string $nick * @param string $nick
* @return string * @return string
*/ */
function User_validate_Nick($nick) function User_validate_Nick($nick)
{ {
return preg_replace('/([^\wüöäß. +*-]{1,})/ui', '', $nick); return preg_replace('/([^\p{L}\p{N}-_ ]+)/ui', '', trim($nick));
} }
/** /**