From c166f246f88a22ad081b649e116b5ac147d04f76 Mon Sep 17 00:00:00 2001 From: brain Date: Mon, 28 May 2007 23:12:01 +0000 Subject: No flags now means all flags when in the config, so that filters defined in older configs are forwards compatible git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7182 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/extra/m_filter_pcre.cpp | 4 ++++ src/modules/m_filter.cpp | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'src/modules') diff --git a/src/modules/extra/m_filter_pcre.cpp b/src/modules/extra/m_filter_pcre.cpp index 8823e385e..c2cc1f40f 100644 --- a/src/modules/extra/m_filter_pcre.cpp +++ b/src/modules/extra/m_filter_pcre.cpp @@ -140,6 +140,10 @@ class ModuleFilterPCRE : public FilterBase std::string action = MyConf.ReadValue("keyword", "action", index); std::string flags = MyConf.ReadValue("keyword", "flags", index); long gline_time = ServerInstance->Duration(MyConf.ReadValue("keyword", "duration", index).c_str()); + if (action.empty()) + action = "none"; + if (flags.empty()) + flags = "*"; re = pcre_compile(pattern.c_str(),0,&error,&erroffset,NULL); diff --git a/src/modules/m_filter.cpp b/src/modules/m_filter.cpp index 9dda30f66..8feb5be41 100644 --- a/src/modules/m_filter.cpp +++ b/src/modules/m_filter.cpp @@ -107,8 +107,10 @@ class ModuleFilter : public FilterBase std::string do_action = MyConf->ReadValue("keyword","action",index); std::string flags = MyConf->ReadValue("keyword","flags",index); long gline_time = ServerInstance->Duration(MyConf->ReadValue("keyword","duration",index).c_str()); - if (do_action == "") + if (do_action.empty()) do_action = "none"; + if (flags.empty()) + flags = "*"; FilterResult* x = new FilterResult(pattern, reason, do_action, gline_time, flags); filters[pattern] = x; } -- cgit v1.2.3