From e3c9eb8e7106058303d5c35ba0af6e003b2d6130 Mon Sep 17 00:00:00 2001 From: Shivaram Lingamneni Date: Wed, 19 Jan 2022 04:14:00 -0500 Subject: [PATCH] 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. --- irc/client_lookup_set.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/irc/client_lookup_set.go b/irc/client_lookup_set.go index 833e7876..2256c4f9 100644 --- a/irc/client_lookup_set.go +++ b/irc/client_lookup_set.go @@ -101,8 +101,10 @@ func (clients *ClientManager) SetNick(client *Client, session *Session, newNick // on previous versions of Ergo: if newNick != accountName { // can't contain "disfavored" characters like <, or start with a $ because - // it collides with the massmessage mask syntax: - if strings.ContainsAny(newNick, disfavoredNameCharacters) || strings.HasPrefix(newNick, "$") { + // it collides with the massmessage mask syntax. '0' conflicts with the use of 0 + // as a placeholder in WHOX (#1896): + if strings.ContainsAny(newNick, disfavoredNameCharacters) || strings.HasPrefix(newNick, "$") || + newNick == "0" { return "", errNicknameInvalid, false } }