fix user nick validation, fixes #369
This commit is contained in:
parent
a5f5dc52c8
commit
0f273988c9
|
@ -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));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue