mirror of
https://github.com/ergochat/ergo.git
synced 2024-11-14 07:59:31 +01:00
fix #1436
This commit is contained in:
parent
31003bd02d
commit
48d5bd9144
@ -117,6 +117,10 @@ func (clients *ClientManager) SetNick(client *Client, session *Session, newNick
|
|||||||
realname := client.realname
|
realname := client.realname
|
||||||
client.stateMutex.RUnlock()
|
client.stateMutex.RUnlock()
|
||||||
|
|
||||||
|
if newNick != accountName && strings.ContainsAny(newNick, disfavoredNameCharacters) {
|
||||||
|
return "", errNicknameInvalid, false
|
||||||
|
}
|
||||||
|
|
||||||
// recompute always-on status, because client.alwaysOn is not set for unregistered clients
|
// recompute always-on status, because client.alwaysOn is not set for unregistered clients
|
||||||
var alwaysOn, useAccountName bool
|
var alwaysOn, useAccountName bool
|
||||||
if account != "" {
|
if account != "" {
|
||||||
|
@ -31,6 +31,11 @@ const (
|
|||||||
// @ separates username from hostname
|
// @ separates username from hostname
|
||||||
// : means trailing
|
// : means trailing
|
||||||
protocolBreakingNameCharacters = " ,*?.!@:"
|
protocolBreakingNameCharacters = " ,*?.!@:"
|
||||||
|
|
||||||
|
// #1436: we discovered that these characters are problematic,
|
||||||
|
// so we're disallowing them in new nicks/account names, but allowing
|
||||||
|
// previously registered names
|
||||||
|
disfavoredNameCharacters = `<>'"`
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
Loading…
Reference in New Issue
Block a user