From 03d78bf95d6a4a4669c7b2d0a8eaabe640d378ff Mon Sep 17 00:00:00 2001 From: Bram Matthys Date: Sat, 14 Aug 2021 17:57:22 +0200 Subject: [PATCH] Fix looking up the wrong extban in some cases. ~T => ~text => starts with ~t => ~time... fun. --- src/api-extban.c | 2 +- src/modules/extbans/textban.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/api-extban.c b/src/api-extban.c index 07c922417..4fe3f59e7 100644 --- a/src/api-extban.c +++ b/src/api-extban.c @@ -56,7 +56,7 @@ Extban *findmod_by_bantype(char *str, char **remainder) for (i=0; i <= ExtBan_highest; i++) { - if (ExtBan_Table[i].letter == str[1]) + if ((str[2] == ':') && (ExtBan_Table[i].letter == str[1])) return &ExtBan_Table[i]; if (ExtBan_Table[i].name && !strncmp(ExtBan_Table[i].name, str+1, strlen(ExtBan_Table[i].name))) return &ExtBan_Table[i]; diff --git a/src/modules/extbans/textban.c b/src/modules/extbans/textban.c index 482ae9062..f405beb9b 100644 --- a/src/modules/extbans/textban.c +++ b/src/modules/extbans/textban.c @@ -372,9 +372,9 @@ char *extban_modeT_conv_param(BanContext *b, Extban *extban) /* Rebuild the string.. can be cut off if too long. */ #ifdef UHOSTFEATURE - snprintf(retbuf, sizeof(retbuf), "~T:%s:%s:%s", uhost, action, text); + snprintf(retbuf, sizeof(retbuf), "%s:%s:%s", uhost, action, text); #else - snprintf(retbuf, sizeof(retbuf), "~T:%s:%s", action, text); + snprintf(retbuf, sizeof(retbuf), "%s:%s", action, text); #endif return retbuf; }