Преглед на файлове

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 години
родител
ревизия
e3c9eb8e71
променени са 1 файла, в които са добавени 4 реда и са изтрити 2 реда
  1. 4
    2
      irc/client_lookup_set.go

+ 4
- 2
irc/client_lookup_set.go Целия файл

@@ -101,8 +101,10 @@ func (clients *ClientManager) SetNick(client *Client, session *Session, newNick
101 101
 	// on previous versions of Ergo:
102 102
 	if newNick != accountName {
103 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 108
 			return "", errNicknameInvalid, false
107 109
 		}
108 110
 	}

Loading…
Отказ
Запис