1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-06-27 09:26:39 +02:00

Fix looking up the wrong extban in some cases.

~T => ~text => starts with ~t => ~time... fun.
This commit is contained in:
Bram Matthys
2021-08-14 17:57:22 +02:00
parent 75dbd99614
commit 03d78bf95d
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -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];
+2 -2
View File
@@ -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;
}