summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-05-28 23:12:01 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-05-28 23:12:01 +0000
commitc166f246f88a22ad081b649e116b5ac147d04f76 (patch)
treec21aec87a54b28b801b17300b4b948629fc18b2b
parent516655d85fbf3234052cf8c69748a735bb09543b (diff)
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
-rw-r--r--src/modules/extra/m_filter_pcre.cpp4
-rw-r--r--src/modules/m_filter.cpp4
2 files changed, 7 insertions, 1 deletions
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;
}