]> jfr.im git - irc/unrealircd/unrealircd.git/commitdiff
Fix STATS output for config-based spamfilters with reasons with spaces.
authorBram Matthys <redacted>
Fri, 6 Oct 2023 05:36:26 +0000 (07:36 +0200)
committerBram Matthys <redacted>
Fri, 6 Oct 2023 05:36:26 +0000 (07:36 +0200)
For config-based spamfilters, the reason was not escaped, meaning that
spaces and underscores did not work as expected.
For example, in "STATS spamfilter" the spaces were displayed as-is
which means that the numeric output was not really parsable.

Apparently this bug exists since UnrealIRCd 5 already...

src/modules/tkl.c

index c6c0943749eb5d9cde013d042265e89c61429ee0..d21df58115ec98d0987138a98fd398b1c52ec847 100644 (file)
@@ -638,6 +638,7 @@ int tkl_config_run_spamfilter(ConfigFile *cf, ConfigEntry *ce, int type)
        if (match)
                m = unreal_create_match(match_type, match, NULL);
 
+       banreason = unreal_encodespace(banreason);
        tkl_add_spamfilter(TKL_SPAMF,
                           id,
                           target,