Restricted unreg usernames
Can now only be made up of [a-z][A-Z][0-9][-_]
This commit is contained in:
parent
1e06a971fa
commit
70ef95931e
1 changed files with 7 additions and 3 deletions
|
@ -102,9 +102,13 @@ bool Servatrice_DatabaseInterface::usernameIsValid(const QString &user)
|
|||
result.reserve(user.size());
|
||||
foreach (const QChar& c, user) {
|
||||
switch (c.category()) {
|
||||
// TODO: Figure out exactly which categories are OK and not
|
||||
case QChar::Other_Control: break;
|
||||
default: result += c;
|
||||
case QChar::Letter_Uppercase: //[A-Z]
|
||||
case QChar::Letter_Lowercase: //[a-z]
|
||||
case QChar::Number_DecimalDigit: //[0-9]
|
||||
case QChar::Punctuation_Connector: //[-_]
|
||||
result += c;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
result = result.trimmed();
|
||||
|
|
Loading…
Reference in a new issue