Browse Source

fix #1436

tags/v2.5.0-rc1
Shivaram Lingamneni 3 years ago
parent
commit
48d5bd9144
2 changed files with 9 additions and 0 deletions
  1. 4
    0
      irc/client_lookup_set.go
  2. 5
    0
      irc/strings.go

+ 4
- 0
irc/client_lookup_set.go View File

@@ -117,6 +117,10 @@ func (clients *ClientManager) SetNick(client *Client, session *Session, newNick
117 117
 	realname := client.realname
118 118
 	client.stateMutex.RUnlock()
119 119
 
120
+	if newNick != accountName && strings.ContainsAny(newNick, disfavoredNameCharacters) {
121
+		return "", errNicknameInvalid, false
122
+	}
123
+
120 124
 	// recompute always-on status, because client.alwaysOn is not set for unregistered clients
121 125
 	var alwaysOn, useAccountName bool
122 126
 	if account != "" {

+ 5
- 0
irc/strings.go View File

@@ -31,6 +31,11 @@ const (
31 31
 	// @ separates username from hostname
32 32
 	// : means trailing
33 33
 	protocolBreakingNameCharacters = " ,*?.!@:"
34
+
35
+	// #1436: we discovered that these characters are problematic,
36
+	// so we're disallowing them in new nicks/account names, but allowing
37
+	// previously registered names
38
+	disfavoredNameCharacters = `<>'"`
34 39
 )
35 40
 
36 41
 var (

Loading…
Cancel
Save