• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

What are the allowable characters in a name?

Jake Bunce

XenForo moderator
Staff member
#4
Commas are not allowed as they are used to delimit lists of usernames. There are no other restricted characters to my knowledge. But of course you can impose your own requirements on usernames by defining a regex as Brogan pointed out.
 

bottiger

Active member
#5
There are other restricted characters.

This regex allowed one of the problem names to work.

[\u0000-\u001f\u0080-\u009f]

I need to know if there are more.
 

Jake Bunce

XenForo moderator
Staff member
#6
This function verifies usernames:

XenForo_DataWriter_User::_verifyUsername

There are several restrictions, many of which are user-defined such as censored words.

What error message are you getting? That will help to know which check is failing.
 

Jake Bunce

XenForo moderator
Staff member
#8
Ok, it is failing this check:

Code:
		// ignore check if unicode properties aren't compiled
		try
		{
			if (@preg_match("/\p{C}/u", $username))
			{
				$this->error(new XenForo_Phrase('please_enter_name_without_using_control_characters'), 'username');
				return false;
			}
		}
		catch (Exception $e) {}
For reference:
http://en.wikipedia.org/wiki/Control_character