Commit 70ef9593 authored by Matt Lowe's avatar Matt Lowe
Browse files

Restricted unreg usernames

Can now only be made up of [a-z][A-Z][0-9][-_]
parent 1e06a971
......@@ -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();
......
Supports Markdown
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