2 * InspIRCd -- Internet Relay Chat Daemon
4 * Copyright (C) 2009 Daniel De Graaf <danieldg@inspircd.org>
5 * Copyright (C) 2004, 2008 Craig Edwards <craigedwards@brainbox.cc>
6 * Copyright (C) 2007 Dennis Friis <peavey@inspircd.org>
7 * Copyright (C) 2007 Robin Burchell <robin+git@viroteck.net>
9 * This file is part of InspIRCd. InspIRCd is free software: you can
10 * redistribute it and/or modify it under the terms of the GNU General Public
11 * License as published by the Free Software Foundation, version 2.
13 * This program is distributed in the hope that it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
25 #include "modules/regex.h"
26 #include "modules/server.h"
27 #include "modules/shun.h"
28 #include "modules/stats.h"
60 bool flag_part_message;
61 bool flag_quit_message;
64 bool flag_strip_color;
66 FilterResult(dynamic_reference<RegexFactory>& RegexEngine, const std::string& free, const std::string& rea, FilterAction act, long gt, const std::string& fla, bool cfg)
74 throw ModuleException("Regex module implementing '"+RegexEngine.GetProvider()+"' is not loaded!");
75 regex = RegexEngine->Create(free);
79 char FillFlags(const std::string &fl)
81 flag_no_opers = flag_part_message = flag_quit_message = flag_privmsg =
82 flag_notice = flag_strip_color = false;
84 for (std::string::const_iterator n = fl.begin(); n != fl.end(); ++n)
92 flag_part_message = true;
95 flag_quit_message = true;
104 flag_strip_color = true;
107 flag_no_opers = flag_part_message = flag_quit_message =
108 flag_privmsg = flag_notice = flag_strip_color = true;
118 std::string GetFlags()
122 flags.push_back('o');
123 if (flag_part_message)
124 flags.push_back('P');
125 if (flag_quit_message)
126 flags.push_back('q');
128 flags.push_back('p');
130 flags.push_back('n');
132 /* Order is important here, 'c' must be the last char in the string as it is unsupported
133 * on < 2.0.10, and the logic in FillFlags() stops parsing when it ecounters an unknown
136 if (flag_strip_color)
137 flags.push_back('c');
140 flags.push_back('-');
150 class CommandFilter : public Command
153 CommandFilter(Module* f)
154 : Command(f, "FILTER", 1, 5)
157 this->syntax = "<filter-definition> <action> <flags> [<duration>] :<reason>";
159 CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE;
161 RouteDescriptor GetRouting(User* user, const Params& parameters) CXX11_OVERRIDE
163 return ROUTE_BROADCAST;
167 class ModuleFilter : public Module, public ServerEventListener, public Stats::EventListener
169 typedef insp::flat_set<std::string, irc::insensitive_swo> ExemptTargetSet;
173 RegexFactory* factory;
177 CommandFilter filtcommand;
178 dynamic_reference<RegexFactory> RegexEngine;
180 std::vector<FilterResult> filters;
183 // List of channel names excluded from filtering.
184 ExemptTargetSet exemptedchans;
186 // List of target nicknames excluded from filtering.
187 ExemptTargetSet exemptednicks;
190 void init() CXX11_OVERRIDE;
191 CullResult cull() CXX11_OVERRIDE;
192 ModResult OnUserPreMessage(User* user, const MessageTarget& target, MessageDetails& details) CXX11_OVERRIDE;
193 FilterResult* FilterMatch(User* user, const std::string &text, int flags);
194 bool DeleteFilter(const std::string &freeform);
195 std::pair<bool, std::string> AddFilter(const std::string &freeform, FilterAction type, const std::string &reason, long duration, const std::string &flags);
196 void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE;
197 Version GetVersion() CXX11_OVERRIDE;
198 std::string EncodeFilter(FilterResult* filter);
199 FilterResult DecodeFilter(const std::string &data);
200 void OnSyncNetwork(ProtocolInterface::Server& server) CXX11_OVERRIDE;
201 void OnDecodeMetaData(Extensible* target, const std::string &extname, const std::string &extdata) CXX11_OVERRIDE;
202 ModResult OnStats(Stats::Context& stats) CXX11_OVERRIDE;
203 ModResult OnPreCommand(std::string& command, CommandBase::Params& parameters, LocalUser* user, bool validated) CXX11_OVERRIDE;
204 void OnUnloadModule(Module* mod) CXX11_OVERRIDE;
205 bool AppliesToMe(User* user, FilterResult* filter, int flags);
207 static bool StringToFilterAction(const std::string& str, FilterAction& fa);
208 static std::string FilterActionToString(FilterAction fa);
211 CmdResult CommandFilter::Handle(User* user, const Params& parameters)
213 if (parameters.size() == 1)
215 /* Deleting a filter */
216 Module *me = creator;
217 if (static_cast<ModuleFilter *>(me)->DeleteFilter(parameters[0]))
219 user->WriteNotice("*** Removed filter '" + parameters[0] + "'");
220 ServerInstance->SNO->WriteToSnoMask(IS_LOCAL(user) ? 'f' : 'F', "FILTER: "+user->nick+" removed filter '"+parameters[0]+"'");
225 user->WriteNotice("*** Filter '" + parameters[0] + "' not found in list, try /stats s.");
231 /* Adding a filter */
232 if (parameters.size() >= 4)
234 const std::string& freeform = parameters[0];
236 const std::string& flags = parameters[2];
237 unsigned int reasonindex;
240 if (!ModuleFilter::StringToFilterAction(parameters[1], type))
242 if (ServerInstance->XLines->GetFactory("SHUN"))
243 user->WriteNotice("*** Invalid filter type '" + parameters[1] + "'. Supported types are 'gline', 'zline', 'none', 'block', 'silent', 'kill', and 'shun'.");
245 user->WriteNotice("*** Invalid filter type '" + parameters[1] + "'. Supported types are 'gline', 'zline', 'none', 'block', 'silent', and 'kill'.");
249 if (type == FA_GLINE || type == FA_ZLINE || type == FA_SHUN)
251 if (parameters.size() >= 5)
253 duration = InspIRCd::Duration(parameters[3]);
258 user->WriteNotice("*** Not enough parameters: When setting a '" + parameters[1] + "' type filter, a duration must be specified as the third parameter.");
267 Module *me = creator;
268 std::pair<bool, std::string> result = static_cast<ModuleFilter *>(me)->AddFilter(freeform, type, parameters[reasonindex], duration, flags);
271 user->WriteNotice("*** Added filter '" + freeform + "', type '" + parameters[1] + "'" +
272 (duration ? ", duration " + parameters[3] : "") + ", flags '" + flags + "', reason: '" +
273 parameters[reasonindex] + "'");
275 ServerInstance->SNO->WriteToSnoMask(IS_LOCAL(user) ? 'f' : 'F', "FILTER: "+user->nick+" added filter '"+freeform+"', type '"+parameters[1]+"', "+(duration ? "duration "+parameters[3]+", " : "")+"flags '"+flags+"', reason: "+parameters[reasonindex]);
281 user->WriteNotice("*** Filter '" + freeform + "' could not be added: " + result.second);
287 user->WriteNotice("*** Not enough parameters.");
294 bool ModuleFilter::AppliesToMe(User* user, FilterResult* filter, int iflags)
296 if ((filter->flag_no_opers) && user->IsOper())
298 if ((iflags & FLAG_PRIVMSG) && (!filter->flag_privmsg))
300 if ((iflags & FLAG_NOTICE) && (!filter->flag_notice))
302 if ((iflags & FLAG_QUIT) && (!filter->flag_quit_message))
304 if ((iflags & FLAG_PART) && (!filter->flag_part_message))
309 ModuleFilter::ModuleFilter()
310 : ServerEventListener(this)
311 , Stats::EventListener(this)
314 , RegexEngine(this, "regex")
318 void ModuleFilter::init()
320 ServerInstance->SNO->EnableSnomask('f', "FILTER");
323 CullResult ModuleFilter::cull()
326 return Module::cull();
329 void ModuleFilter::FreeFilters()
331 for (std::vector<FilterResult>::const_iterator i = filters.begin(); i != filters.end(); ++i)
337 ModResult ModuleFilter::OnUserPreMessage(User* user, const MessageTarget& msgtarget, MessageDetails& details)
339 // Leave remote users and servers alone
341 return MOD_RES_PASSTHRU;
343 flags = (details.type == MSG_PRIVMSG) ? FLAG_PRIVMSG : FLAG_NOTICE;
345 FilterResult* f = this->FilterMatch(user, details.text, flags);
349 if (msgtarget.type == MessageTarget::TYPE_USER)
351 User* t = msgtarget.Get<User>();
352 // Check if the target nick is exempted, if yes, ignore this message
353 if (exemptednicks.count(t->nick))
354 return MOD_RES_PASSTHRU;
358 else if (msgtarget.type == MessageTarget::TYPE_CHANNEL)
360 Channel* t = msgtarget.Get<Channel>();
361 if (exemptedchans.count(t->name))
362 return MOD_RES_PASSTHRU;
366 if (f->action == FA_BLOCK)
368 ServerInstance->SNO->WriteGlobalSno('f', InspIRCd::Format("%s had their message to %s filtered as it matched %s (%s)",
369 user->nick.c_str(), target.c_str(), f->freeform.c_str(), f->reason.c_str()));
372 if (msgtarget.type == MessageTarget::TYPE_CHANNEL)
373 user->WriteNumeric(ERR_CANNOTSENDTOCHAN, target, InspIRCd::Format("Message to channel blocked and opers notified (%s)", f->reason.c_str()));
375 user->WriteNotice("Your message to "+target+" was blocked and opers notified: "+f->reason);
378 details.echo_original = true;
380 else if (f->action == FA_SILENT)
384 if (msgtarget.type == MessageTarget::TYPE_CHANNEL)
385 user->WriteNumeric(ERR_CANNOTSENDTOCHAN, target, InspIRCd::Format("Message to channel blocked (%s)", f->reason.c_str()));
387 user->WriteNotice("Your message to "+target+" was blocked: "+f->reason);
390 details.echo_original = true;
392 else if (f->action == FA_KILL)
394 ServerInstance->SNO->WriteGlobalSno('f', InspIRCd::Format("%s was killed because their message to %s matched %s (%s)",
395 user->nick.c_str(), target.c_str(), f->freeform.c_str(), f->reason.c_str()));
396 ServerInstance->Users->QuitUser(user, "Filtered: " + f->reason);
398 else if (f->action == FA_SHUN && (ServerInstance->XLines->GetFactory("SHUN")))
400 Shun* sh = new Shun(ServerInstance->Time(), f->duration, ServerInstance->Config->ServerName.c_str(), f->reason.c_str(), user->GetIPString());
401 ServerInstance->SNO->WriteGlobalSno('f', InspIRCd::Format("%s was shunned because their message to %s matched %s (%s)",
402 user->nick.c_str(), target.c_str(), f->freeform.c_str(), f->reason.c_str()));
403 if (ServerInstance->XLines->AddLine(sh, NULL))
405 ServerInstance->XLines->ApplyLines();
410 else if (f->action == FA_GLINE)
412 GLine* gl = new GLine(ServerInstance->Time(), f->duration, ServerInstance->Config->ServerName.c_str(), f->reason.c_str(), "*", user->GetIPString());
413 ServerInstance->SNO->WriteGlobalSno('f', InspIRCd::Format("%s was glined because their message to %s matched %s (%s)",
414 user->nick.c_str(), target.c_str(), f->freeform.c_str(), f->reason.c_str()));
415 if (ServerInstance->XLines->AddLine(gl,NULL))
417 ServerInstance->XLines->ApplyLines();
422 else if (f->action == FA_ZLINE)
424 ZLine* zl = new ZLine(ServerInstance->Time(), f->duration, ServerInstance->Config->ServerName.c_str(), f->reason.c_str(), user->GetIPString());
425 ServerInstance->SNO->WriteGlobalSno('f', InspIRCd::Format("%s was zlined because their message to %s matched %s (%s)",
426 user->nick.c_str(), target.c_str(), f->freeform.c_str(), f->reason.c_str()));
427 if (ServerInstance->XLines->AddLine(zl,NULL))
429 ServerInstance->XLines->ApplyLines();
435 ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, user->nick + " had their message filtered, target was " + target + ": " + f->reason + " Action: " + ModuleFilter::FilterActionToString(f->action));
438 return MOD_RES_PASSTHRU;
441 ModResult ModuleFilter::OnPreCommand(std::string& command, CommandBase::Params& parameters, LocalUser* user, bool validated)
448 if (command == "QUIT")
450 /* QUIT with no reason: nothing to do */
451 if (parameters.size() < 1)
452 return MOD_RES_PASSTHRU;
457 else if (command == "PART")
459 /* PART with no reason: nothing to do */
460 if (parameters.size() < 2)
461 return MOD_RES_PASSTHRU;
463 if (exemptedchans.count(parameters[0]))
464 return MOD_RES_PASSTHRU;
470 /* We're only messing with PART and QUIT */
471 return MOD_RES_PASSTHRU;
473 FilterResult* f = this->FilterMatch(user, parameters[parting ? 1 : 0], flags);
475 /* PART or QUIT reason doesnt match a filter */
476 return MOD_RES_PASSTHRU;
478 /* We cant block a part or quit, so instead we change the reason to 'Reason filtered' */
479 parameters[parting ? 1 : 0] = "Reason filtered";
481 /* We're blocking, OR theyre quitting and its a KILL action
482 * (we cant kill someone whos already quitting, so filter them anyway)
484 if ((f->action == FA_BLOCK) || (((!parting) && (f->action == FA_KILL))) || (f->action == FA_SILENT))
486 return MOD_RES_PASSTHRU;
490 /* Are they parting, if so, kill is applicable */
491 if ((parting) && (f->action == FA_KILL))
493 user->WriteNotice("*** Your PART message was filtered: " + f->reason);
494 ServerInstance->Users->QuitUser(user, "Filtered: " + f->reason);
496 if (f->action == FA_GLINE)
498 /* Note: We gline *@IP so that if their host doesnt resolve the gline still applies. */
499 GLine* gl = new GLine(ServerInstance->Time(), f->duration, ServerInstance->Config->ServerName.c_str(), f->reason.c_str(), "*", user->GetIPString());
500 ServerInstance->SNO->WriteGlobalSno('f', InspIRCd::Format("%s was glined because their %s message matched %s (%s)",
501 user->nick.c_str(), command.c_str(), f->freeform.c_str(), f->reason.c_str()));
503 if (ServerInstance->XLines->AddLine(gl,NULL))
505 ServerInstance->XLines->ApplyLines();
510 if (f->action == FA_ZLINE)
512 ZLine* zl = new ZLine(ServerInstance->Time(), f->duration, ServerInstance->Config->ServerName.c_str(), f->reason.c_str(), user->GetIPString());
513 ServerInstance->SNO->WriteGlobalSno('f', InspIRCd::Format("%s was zlined because their %s message matched %s (%s)",
514 user->nick.c_str(), command.c_str(), f->freeform.c_str(), f->reason.c_str()));
516 if (ServerInstance->XLines->AddLine(zl,NULL))
518 ServerInstance->XLines->ApplyLines();
523 else if (f->action == FA_SHUN && (ServerInstance->XLines->GetFactory("SHUN")))
525 /* Note: We shun *!*@IP so that if their host doesnt resolve the shun still applies. */
526 Shun* sh = new Shun(ServerInstance->Time(), f->duration, ServerInstance->Config->ServerName.c_str(), f->reason.c_str(), user->GetIPString());
527 ServerInstance->SNO->WriteGlobalSno('f', InspIRCd::Format("%s was shunned because their %s message matched %s (%s)",
528 user->nick.c_str(), command.c_str(), f->freeform.c_str(), f->reason.c_str()));
529 if (ServerInstance->XLines->AddLine(sh, NULL))
531 ServerInstance->XLines->ApplyLines();
539 return MOD_RES_PASSTHRU;
542 void ModuleFilter::ReadConfig(ConfigStatus& status)
544 ConfigTagList tags = ServerInstance->Config->ConfTags("exemptfromfilter");
545 exemptedchans.clear();
546 exemptednicks.clear();
548 for (ConfigIter i = tags.first; i != tags.second; ++i)
550 ConfigTag* tag = i->second;
552 // If "target" is not found, try the old "channel" key to keep compatibility with 2.0 configs
553 const std::string target = tag->getString("target", tag->getString("channel"));
556 if (target[0] == '#')
557 exemptedchans.insert(target);
559 exemptednicks.insert(target);
563 ConfigTag* tag = ServerInstance->Config->ConfValue("filteropts");
564 std::string newrxengine = tag->getString("engine");
565 notifyuser = tag->getBool("notifyuser", true);
567 factory = RegexEngine ? (RegexEngine.operator->()) : NULL;
569 if (newrxengine.empty())
570 RegexEngine.SetProvider("regex");
572 RegexEngine.SetProvider("regex/" + newrxengine);
576 if (newrxengine.empty())
577 ServerInstance->SNO->WriteGlobalSno('f', "WARNING: No regex engine loaded - Filter functionality disabled until this is corrected.");
579 ServerInstance->SNO->WriteGlobalSno('f', "WARNING: Regex engine '%s' is not loaded - Filter functionality disabled until this is corrected.", newrxengine.c_str());
586 if ((!initing) && (RegexEngine.operator->() != factory))
588 ServerInstance->SNO->WriteGlobalSno('f', "Dumping all filters due to regex engine change");
596 Version ModuleFilter::GetVersion()
598 return Version("Text (spam) filtering", VF_VENDOR | VF_COMMON, RegexEngine ? RegexEngine->name : "");
601 std::string ModuleFilter::EncodeFilter(FilterResult* filter)
603 std::ostringstream stream;
604 std::string x = filter->freeform;
606 /* Hax to allow spaces in the freeform without changing the design of the irc protocol */
607 for (std::string::iterator n = x.begin(); n != x.end(); n++)
611 stream << x << " " << FilterActionToString(filter->action) << " " << filter->GetFlags() << " " << filter->duration << " :" << filter->reason;
615 FilterResult ModuleFilter::DecodeFilter(const std::string &data)
617 std::string filteraction;
619 irc::tokenstream tokens(data);
620 tokens.GetMiddle(res.freeform);
621 tokens.GetMiddle(filteraction);
622 if (!StringToFilterAction(filteraction, res.action))
623 throw ModuleException("Invalid action: " + filteraction);
625 std::string filterflags;
626 tokens.GetMiddle(filterflags);
627 char c = res.FillFlags(filterflags);
629 throw ModuleException("Invalid flag: '" + std::string(1, c) + "'");
631 std::string duration;
632 tokens.GetMiddle(duration);
633 res.duration = ConvToInt(duration);
635 tokens.GetTrailing(res.reason);
637 /* Hax to allow spaces in the freeform without changing the design of the irc protocol */
638 for (std::string::iterator n = res.freeform.begin(); n != res.freeform.end(); n++)
645 void ModuleFilter::OnSyncNetwork(ProtocolInterface::Server& server)
647 for (std::vector<FilterResult>::iterator i = filters.begin(); i != filters.end(); ++i)
649 FilterResult& filter = *i;
650 if (filter.from_config)
653 server.SendMetaData("filter", EncodeFilter(&filter));
657 void ModuleFilter::OnDecodeMetaData(Extensible* target, const std::string &extname, const std::string &extdata)
659 if ((target == NULL) && (extname == "filter"))
663 FilterResult data = DecodeFilter(extdata);
664 this->AddFilter(data.freeform, data.action, data.reason, data.duration, data.GetFlags());
666 catch (ModuleException& e)
668 ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "Error when unserializing filter: " + e.GetReason());
673 FilterResult* ModuleFilter::FilterMatch(User* user, const std::string &text, int flgs)
675 static std::string stripped_text;
676 stripped_text.clear();
678 for (std::vector<FilterResult>::iterator i = filters.begin(); i != filters.end(); ++i)
680 FilterResult* filter = &*i;
682 /* Skip ones that dont apply to us */
683 if (!AppliesToMe(user, filter, flgs))
686 if ((filter->flag_strip_color) && (stripped_text.empty()))
688 stripped_text = text;
689 InspIRCd::StripColor(stripped_text);
692 if (filter->regex->Matches(filter->flag_strip_color ? stripped_text : text))
698 bool ModuleFilter::DeleteFilter(const std::string &freeform)
700 for (std::vector<FilterResult>::iterator i = filters.begin(); i != filters.end(); i++)
702 if (i->freeform == freeform)
712 std::pair<bool, std::string> ModuleFilter::AddFilter(const std::string &freeform, FilterAction type, const std::string &reason, long duration, const std::string &flgs)
714 for (std::vector<FilterResult>::iterator i = filters.begin(); i != filters.end(); i++)
716 if (i->freeform == freeform)
718 return std::make_pair(false, "Filter already exists");
724 filters.push_back(FilterResult(RegexEngine, freeform, reason, type, duration, flgs, false));
726 catch (ModuleException &e)
728 ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "Error in regular expression '%s': %s", freeform.c_str(), e.GetReason().c_str());
729 return std::make_pair(false, e.GetReason());
731 return std::make_pair(true, "");
734 bool ModuleFilter::StringToFilterAction(const std::string& str, FilterAction& fa)
736 if (stdalgo::string::equalsci(str, "gline"))
738 else if (stdalgo::string::equalsci(str, "zline"))
740 else if (stdalgo::string::equalsci(str, "block"))
742 else if (stdalgo::string::equalsci(str, "silent"))
744 else if (stdalgo::string::equalsci(str, "kill"))
746 else if (stdalgo::string::equalsci(str, "shun") && (ServerInstance->XLines->GetFactory("SHUN")))
748 else if (stdalgo::string::equalsci(str, "none"))
756 std::string ModuleFilter::FilterActionToString(FilterAction fa)
760 case FA_GLINE: return "gline";
761 case FA_ZLINE: return "zline";
762 case FA_BLOCK: return "block";
763 case FA_SILENT: return "silent";
764 case FA_KILL: return "kill";
765 case FA_SHUN: return "shun";
766 default: return "none";
770 void ModuleFilter::ReadFilters()
772 for (std::vector<FilterResult>::iterator filter = filters.begin(); filter != filters.end(); )
774 if (filter->from_config)
776 ServerInstance->SNO->WriteGlobalSno('f', "FILTER: removing filter '" + filter->freeform + "' due to config rehash.");
777 delete filter->regex;
778 filter = filters.erase(filter);
782 // The filter is not from the config.
786 ConfigTagList tags = ServerInstance->Config->ConfTags("keyword");
787 for (ConfigIter i = tags.first; i != tags.second; ++i)
789 std::string pattern = i->second->getString("pattern");
790 std::string reason = i->second->getString("reason");
791 std::string action = i->second->getString("action");
792 std::string flgs = i->second->getString("flags");
793 unsigned long duration = i->second->getDuration("duration", 10*60, 1);
798 if (!StringToFilterAction(action, fa))
803 filters.push_back(FilterResult(RegexEngine, pattern, reason, fa, duration, flgs, true));
804 ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "Regular expression %s loaded.", pattern.c_str());
806 catch (ModuleException &e)
808 ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "Error in regular expression '%s': %s", pattern.c_str(), e.GetReason().c_str());
813 ModResult ModuleFilter::OnStats(Stats::Context& stats)
815 if (stats.GetSymbol() == 's')
817 for (std::vector<FilterResult>::iterator i = filters.begin(); i != filters.end(); i++)
819 stats.AddRow(223, RegexEngine.GetProvider()+":"+i->freeform+" "+i->GetFlags()+" "+FilterActionToString(i->action)+" "+ConvToStr(i->duration)+" :"+i->reason);
821 for (ExemptTargetSet::const_iterator i = exemptedchans.begin(); i != exemptedchans.end(); ++i)
823 stats.AddRow(223, "EXEMPT "+(*i));
825 for (ExemptTargetSet::const_iterator i = exemptednicks.begin(); i != exemptednicks.end(); ++i)
827 stats.AddRow(223, "EXEMPT "+(*i));
830 return MOD_RES_PASSTHRU;
833 void ModuleFilter::OnUnloadModule(Module* mod)
835 // If the regex engine became unavailable or has changed, remove all filters
840 else if (RegexEngine.operator->() != factory)
842 factory = RegexEngine.operator->();
847 MODULE_INIT(ModuleFilter)