diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-11-10 18:42:01 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-11-10 18:42:01 +0000 |
commit | f160e592ad3eadb551b6b066a245336bc2cfc81e (patch) | |
tree | 62cfa15eeb64754861b04cef082fd51422d22fb2 /src/modules/extra | |
parent | f6d4ad6893515722cf702a031cb822ca83ed4c76 (diff) |
Whoops, properly handle rehash now that new filters might be added by /FILTER
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5672 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/extra')
-rw-r--r-- | src/modules/extra/m_filter_pcre.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/modules/extra/m_filter_pcre.cpp b/src/modules/extra/m_filter_pcre.cpp index dde7575ab..a7829871f 100644 --- a/src/modules/extra/m_filter_pcre.cpp +++ b/src/modules/extra/m_filter_pcre.cpp @@ -81,6 +81,7 @@ class ModuleFilterPCRE : public FilterBase { if (i->freeform == freeform) { + pcre_free((*i).regexp); filters.erase(i); return true; } @@ -125,13 +126,10 @@ class ModuleFilterPCRE : public FilterBase { ConfigReader MyConf(ServerInstance); - for (std::vector<PCREFilter>::iterator i = filters.begin(); i != filters.end(); i++) - pcre_free((*i).regexp); - - filters.clear(); - for (int index = 0; index < MyConf.Enumerate("keyword"); index++) { + this->DeleteFilter(MyConf.ReadValue("keyword", "pattern", index)); + std::string pattern = MyConf.ReadValue("keyword", "pattern", index); std::string reason = MyConf.ReadValue("keyword", "reason", index); std::string action = MyConf.ReadValue("keyword", "action", index); |