mirror of
https://github.com/ergochat/ergo.git
synced 2024-11-25 13:29:27 +01:00
Merge pull request #1775 from slingamn/channelkey
fix handling of +k with an empty key parameter
This commit is contained in:
commit
5d2d4a99bc
@ -148,11 +148,7 @@ func ParseDefaultUserModes(rawModes *string) modes.Modes {
|
|||||||
|
|
||||||
// #1021: channel key must be valid as a non-final parameter
|
// #1021: channel key must be valid as a non-final parameter
|
||||||
func validateChannelKey(key string) bool {
|
func validateChannelKey(key string) bool {
|
||||||
// empty string is valid in this context because it unsets the mode
|
return key != "" && key[0] != ':' && strings.IndexByte(key, ' ') == -1
|
||||||
if len(key) == 0 {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return key[0] != ':' && strings.IndexByte(key, ' ') == -1
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ApplyChannelModeChanges applies a given set of mode changes.
|
// ApplyChannelModeChanges applies a given set of mode changes.
|
||||||
|
Loading…
Reference in New Issue
Block a user