mirror of
https://github.com/mumble-voip/mumble.git
synced 2025-10-26 11:19:16 +00:00
CHANGE(server): Untrimmed usernames considered invalid
When checking whether a given username is valid, it being trimmed is now also a criterion. All names with leading and/or trailing whitespace will be considered invalid from now on.
This commit is contained in:
parent
90190bcb01
commit
58fee9705d
@ -2092,7 +2092,9 @@ QString Server::addressToString(const QHostAddress &adr, unsigned short port) {
|
||||
}
|
||||
|
||||
bool Server::validateUserName(const QString &name) {
|
||||
return (qrUserName.exactMatch(name) && (name.length() <= 512));
|
||||
// We expect the name passed to this function to be fully trimmed already. This way we
|
||||
// prevent "empty" names (at least with the default username restriction).
|
||||
return (name.trimmed().length() == name.length() && qrUserName.exactMatch(name) && (name.length() <= 512));
|
||||
}
|
||||
|
||||
bool Server::validateChannelName(const QString &name) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user