Browse Source

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.
tags/v2.10.0-rc1
Shivaram Lingamneni 2 years ago
parent
commit
e3c9eb8e71
1 changed files with 4 additions and 2 deletions
  1. 4
    2
      irc/client_lookup_set.go

+ 4
- 2
irc/client_lookup_set.go View File

101
 	// on previous versions of Ergo:
101
 	// on previous versions of Ergo:
102
 	if newNick != accountName {
102
 	if newNick != accountName {
103
 		// can't contain "disfavored" characters like <, or start with a $ because
103
 		// can't contain "disfavored" characters like <, or start with a $ because
104
-		// it collides with the massmessage mask syntax:
105
-		if strings.ContainsAny(newNick, disfavoredNameCharacters) || strings.HasPrefix(newNick, "$") {
104
+		// it collides with the massmessage mask syntax. '0' conflicts with the use of 0
105
+		// as a placeholder in WHOX (#1896):
106
+		if strings.ContainsAny(newNick, disfavoredNameCharacters) || strings.HasPrefix(newNick, "$") ||
107
+			newNick == "0" {
106
 			return "", errNicknameInvalid, false
108
 			return "", errNicknameInvalid, false
107
 		}
109
 		}
108
 	}
110
 	}

Loading…
Cancel
Save