From 91ec6450b2d4d44cf3d336eb4d359aec7f7024fd Mon Sep 17 00:00:00 2001 From: w00t Date: Mon, 1 Sep 2008 23:44:16 +0000 Subject: Make m_chanfilter grok globbing, meaning +g test?string?lol is now possible to block a word sequence. CAVEAT: you now need to block *word* unless you're blocking a whole sentance at once. Tech note: removes a string copy, which is a Good Thing. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10375 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_chanfilter.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src') diff --git a/src/modules/m_chanfilter.cpp b/src/modules/m_chanfilter.cpp index 30f602a5d..50df5b1cc 100644 --- a/src/modules/m_chanfilter.cpp +++ b/src/modules/m_chanfilter.cpp @@ -89,9 +89,6 @@ class ModuleChanFilter : public Module if (!IS_LOCAL(user) || (CHANOPS_EXEMPT(ServerInstance, 'g') && chan->GetStatus(user) == STATUS_OP)) return 0; - // Create a copy of the string in irc::string - irc::string line = text.c_str(); - modelist* list; chan->GetExt(cf->GetInfoKey(), list); @@ -99,7 +96,7 @@ class ModuleChanFilter : public Module { for (modelist::iterator i = list->begin(); i != list->end(); i++) { - if (line.find(i->mask.c_str()) != std::string::npos) + if (InspIRCd::Match(text, i->mask)) { user->WriteNumeric(936, "%s %s %s :Your message contained a censored word, and was blocked",user->nick.c_str(), chan->name.c_str(), i->mask.c_str()); return 1; -- cgit v1.2.3