summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/modules/m_filter.cpp6
-rw-r--r--src/modules/m_rline.cpp10
2 files changed, 10 insertions, 6 deletions
diff --git a/src/modules/m_filter.cpp b/src/modules/m_filter.cpp
index bc701878b..713643043 100644
--- a/src/modules/m_filter.cpp
+++ b/src/modules/m_filter.cpp
@@ -437,6 +437,8 @@ void ModuleFilter::OnRehash(User* user)
}
}
std::string newrxengine = "regex/" + MyConf.ReadValue("filteropts", "engine", 0);
+ if (newrxengine == "regex/")
+ newrxengine = "regex";
if (RegexEngine.GetProvider() == newrxengine)
return;
@@ -446,14 +448,14 @@ void ModuleFilter::OnRehash(User* user)
RegexEngine.SetProvider(newrxengine);
if (!RegexEngine)
{
- ServerInstance->SNO->WriteGlobalSno('a', "WARNING: Regex engine '%s' is not loaded - Filter functionality disabled until this is corrected.", RegexEngine.GetProvider().c_str());
+ ServerInstance->SNO->WriteGlobalSno('a', "WARNING: Regex engine '%s' is not loaded - Filter functionality disabled until this is corrected.", newrxengine.c_str());
}
ReadFilters(MyConf);
}
Version ModuleFilter::GetVersion()
{
- return Version("Text (spam) filtering", VF_VENDOR | VF_COMMON, RegexEngine.GetProvider());
+ return Version("Text (spam) filtering", VF_VENDOR | VF_COMMON, RegexEngine ? RegexEngine->name : "");
}
diff --git a/src/modules/m_rline.cpp b/src/modules/m_rline.cpp
index 7f5eafd69..d52870284 100644
--- a/src/modules/m_rline.cpp
+++ b/src/modules/m_rline.cpp
@@ -201,7 +201,6 @@ class ModuleRLine : public Module
RLineFactory f;
CommandRLine r;
bool MatchOnNickChange;
- std::string RegexEngine;
public:
ModuleRLine() : rxfactory(this, "regex"), f(rxfactory), r(this, f)
@@ -223,7 +222,7 @@ class ModuleRLine : public Module
virtual Version GetVersion()
{
- return Version("RLINE: Regexp user banning.", VF_COMMON | VF_VENDOR, rxfactory.GetProvider());
+ return Version("RLINE: Regexp user banning.", VF_COMMON | VF_VENDOR, rxfactory ? rxfactory->name : "");
}
virtual void OnUserConnect(LocalUser* user)
@@ -249,10 +248,13 @@ class ModuleRLine : public Module
ZlineOnMatch = Conf.ReadFlag("rline", "zlineonmatch", 0);
std::string newrxengine = Conf.ReadValue("rline", "engine", 0);
- rxfactory.SetProvider("regex/" + newrxengine);
+ if (newrxengine.empty())
+ rxfactory.SetProvider("regex");
+ else
+ rxfactory.SetProvider("regex/" + newrxengine);
if (!rxfactory)
{
- ServerInstance->SNO->WriteToSnoMask('a', "WARNING: Regex engine '%s' is not loaded - R-Line functionality disabled until this is corrected.", RegexEngine.c_str());
+ ServerInstance->SNO->WriteToSnoMask('a', "WARNING: Regex engine '%s' is not loaded - R-Line functionality disabled until this is corrected.", newrxengine.c_str());
}
}