forked from External/ergo
fix #1896
Don't allow any new uses of 0 as a nickname, since it conflicts with the use of 0 as a placeholder for account name in WHOX.
This commit is contained in:
parent
c2bf59ca38
commit
e3c9eb8e71
1 changed files with 4 additions and 2 deletions
|
|
@ -101,8 +101,10 @@ func (clients *ClientManager) SetNick(client *Client, session *Session, newNick
|
||||||
// on previous versions of Ergo:
|
// on previous versions of Ergo:
|
||||||
if newNick != accountName {
|
if newNick != accountName {
|
||||||
// can't contain "disfavored" characters like <, or start with a $ because
|
// can't contain "disfavored" characters like <, or start with a $ because
|
||||||
// it collides with the massmessage mask syntax:
|
// it collides with the massmessage mask syntax. '0' conflicts with the use of 0
|
||||||
if strings.ContainsAny(newNick, disfavoredNameCharacters) || strings.HasPrefix(newNick, "$") {
|
// as a placeholder in WHOX (#1896):
|
||||||
|
if strings.ContainsAny(newNick, disfavoredNameCharacters) || strings.HasPrefix(newNick, "$") ||
|
||||||
|
newNick == "0" {
|
||||||
return "", errNicknameInvalid, false
|
return "", errNicknameInvalid, false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue