Log in

View Full Version : Mod to limit username character types?


gabrielt
03-19-2010, 10:23 PM
Hi,

A problem we are facing is people creating usernames using non-standard ASCII characters, which make our forums to look unprofessional, IMHO. Fresh example:

ëðwîlðsöñ

How can we block users from using this kind of characters?

Thanks,
Gabriel.

final kaoss
03-19-2010, 10:36 PM
look in the user registration options in your admin cp. You can toggle the settings so they can't use those characters in a username


Username Regular Expression
You may require the username to match a PCRE-type regular expression.

(Do not start or end the expression with an escape character)

Examples:

^[A-Z]+$ - Characters from A-Z only
^[A-Z ]+$ - Characters from A-Z including space
^[A-Z0-9 ]+$ - Alphanumeric characters including space
^((?!&#\d+;)[\x20-\x7E])+$ - ASCII characters from 32-127

See PHP.net for more information on regular expressions.

gabrielt
03-19-2010, 10:43 PM
Awesome, this was exactly what I was looking for.

Gabriel.