ソースを参照

disallow initial $ in nicknames

It collides with the massmessage mask syntax. Reported by @emersion
tags/v2.9.0-rc1
Shivaram Lingamneni 2年前
コミット
f40d868cf5
1個のファイルの変更8行の追加2行の削除
  1. 8
    2
      irc/client_lookup_set.go

+ 8
- 2
irc/client_lookup_set.go ファイルの表示

@@ -97,8 +97,14 @@ func (clients *ClientManager) SetNick(client *Client, session *Session, newNick
97 97
 	realname := client.realname
98 98
 	client.stateMutex.RUnlock()
99 99
 
100
-	if newNick != accountName && strings.ContainsAny(newNick, disfavoredNameCharacters) {
101
-		return "", errNicknameInvalid, false
100
+	// these restrictions have grandfather exceptions for nicknames registered
101
+	// on previous versions of Ergo:
102
+	if newNick != accountName {
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, "$") {
106
+			return "", errNicknameInvalid, false
107
+		}
102 108
 	}
103 109
 
104 110
 	// recompute always-on status, because client.alwaysOn is not set for unregistered clients

読み込み中…
キャンセル
保存