From 63420af61af656a454b93c7c2f5f2da29d930df9 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Fri, 6 Mar 2026 16:52:08 +0000 Subject: Add validation to silence extbans. --- modules/silence.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'modules/silence.cpp') diff --git a/modules/silence.cpp b/modules/silence.cpp index a3522adab..3584dcc08 100644 --- a/modules/silence.cpp +++ b/modules/silence.cpp @@ -393,7 +393,24 @@ public: if (mask.empty()) mask.assign("*"); } - if (!extbanmgr || !extbanmgr->Canonicalize(mask)) + + auto clean = true; + if (extbanmgr) + { + switch (extbanmgr->Validate(nullptr, user, nullptr, mask)) + { + case ExtBan::Comparison::NOT_AN_EXTBAN: + break; + + case ExtBan::Comparison::MATCH: + clean = false; + break; + + case ExtBan::Comparison::NOT_MATCH: + return CmdResult::FAILURE; // ExtBan is not allowed. + } + } + if (clean) ModeParser::CleanMask(mask); // If the user specified a flags then use that. Otherwise, default to blocking -- cgit v1.3.1-10-gc9f91