Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Donald Haase
Cockatrice
Commits
5117c0e6
Commit
5117c0e6
authored
Apr 12, 2015
by
Zach
Browse files
Merge pull request #956 from poixen/unreg_usernames
Restricted unreg usernames
parents
a2f416bb
70ef9593
Changes
1
Hide whitespace changes
Inline
Side-by-side
servatrice/src/servatrice_database_interface.cpp
View file @
5117c0e6
...
...
@@ -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
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment