+ ConfigReader MyConf(ServerInstance);
+
+ 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);
+ std::string flgs = MyConf.ReadValue("keyword", "flags", index);
+ long gline_time = ServerInstance->Duration(MyConf.ReadValue("keyword", "duration", index));
+ if (action.empty())
+ action = "none";
+ if (flgs.empty())
+ flgs = "*";
+
+ re = pcre_compile(pattern.c_str(),0,&error,&erroffset,NULL);
+
+ if (!re)
+ {
+ ServerInstance->Logs->Log("CONFIG",DEFAULT,"Error in regular expression: %s at offset %d: %s\n", pattern.c_str(), erroffset, error);
+ ServerInstance->Logs->Log("CONFIG",DEFAULT,"Regular expression %s not loaded.", pattern.c_str());
+ }
+ else
+ {
+ filters.push_back(PCREFilter(re, reason, action, gline_time, pattern, flgs));
+ ServerInstance->Logs->Log("CONFIG",DEFAULT,"Regular expression %s loaded.", pattern.c_str());
+ }
+ }
+ FilterBase::OnRehash(user, parameter);