From d99eba20d8db6b3882910cfe25df505d8892fe57 Mon Sep 17 00:00:00 2001 From: Shivaram Lingamneni Date: Sun, 15 Jun 2025 16:10:08 -0400 Subject: [PATCH] don't trim spaces before validating the key --- irc/metadata.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/irc/metadata.go b/irc/metadata.go index adba3d76..a506b8ba 100644 --- a/irc/metadata.go +++ b/irc/metadata.go @@ -5,7 +5,6 @@ import ( "iter" "maps" "regexp" - "strings" "github.com/ergochat/ergo/irc/caps" "github.com/ergochat/ergo/irc/modes" @@ -109,8 +108,6 @@ func syncChannelMetadata(server *Server, rb *ResponseBuffer, channel *Channel) { var metadataEvilCharsRegexp = regexp.MustCompile("[^A-Za-z0-9_./:-]+") func metadataKeyIsEvil(key string) bool { - key = strings.TrimSpace(key) // just in case - return len(key) == 0 || // key needs to contain stuff key[0] == ':' || // key can't start with a colon metadataEvilCharsRegexp.MatchString(key) // key can't contain the stuff it can't contain