Commit 36a1ecfc authored by Nigel McNie's avatar Nigel McNie
Browse files

Allow usernames to contain many more characters than they do currently when...

Allow usernames to contain many more characters than they do currently when using internal authentication.

The previous restrictions were unnecessarily strict. As per request from MyPortfolio.

Now we actually can has a Mjollnir`!
parent 47a6d7c8
......@@ -114,10 +114,9 @@ class AuthInternal extends Auth {
}
/**
* For internal authentication, usernames can only contain alphanumeric
* characters, and the symbols underscore, full stop and the @ symbol.
*
* The username must also be between three and thirty characters in length.
* Internal authentication allows most standard us-keyboard-typable characters
* for username, as long as the username is between three and thirty
* characters in length.
*
* This method is NOT part of the authentication API. Other authentication
* methods never have to do anything regarding usernames being validated on
......@@ -127,7 +126,7 @@ class AuthInternal extends Auth {
* @return bool Whether the username is valid
*/
public function is_username_valid($username) {
return preg_match('/^[a-zA-Z0-9\._@]{3,30}$/', $username);
return preg_match('/^[a-zA-Z0-9!@#$%^&*()\-_=+\[{\]}\\|;:\'",<\.>\/?`]{3,30}$/', $username);
}
/*
......
<h3>Username</h3>
<p>Your username must be between 3 and 30 characters long, and will not be case sensitive. Your username may be an email address, so it can include alphanumeric characters, full stops and @ symbols.</p>
<p>Your username must be between 3 and 30 characters long, and will not be case sensitive. Letters, numbers and most standard symbols are allowed.</p>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment