From affc69e0b5d99d60764f4a40a2283b7efd4b2a8c Mon Sep 17 00:00:00 2001 From: brain Date: Sat, 4 Mar 2006 16:47:54 +0000 Subject: m_censor skenmy fix git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3444 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_censor.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/modules') diff --git a/src/modules/m_censor.cpp b/src/modules/m_censor.cpp index 0d18ac1e4..b1fa7537d 100644 --- a/src/modules/m_censor.cpp +++ b/src/modules/m_censor.cpp @@ -100,11 +100,11 @@ class ModuleCensor : public Module delete Conf; } - virtual void ReplaceLine(std::string &text,std::string pattern, std::string replace) + virtual void ReplaceLine(irc::string &text, irc::string pattern, irc::string replace) { if ((pattern != "") && (text != "")) { - while (text.find(pattern) != std::string::npos) + while (text.find(pattern) != irc::string::npos) { int pos = text.find(pattern); text.erase(pos,pattern.length()); @@ -122,7 +122,7 @@ class ModuleCensor : public Module for (int index = 0; index < MyConf->Enumerate("badword"); index++) { irc::string pattern = (MyConf->ReadValue("badword","text",index)).c_str(); - if (text2.find(pattern) != std::string::npos) + if (text2.find(pattern) != irc::string::npos) { std::string replace = MyConf->ReadValue("badword","replace",index); @@ -139,7 +139,9 @@ class ModuleCensor : public Module if (active) { - this->ReplaceLine(text,std::string(pattern.c_str()),replace); + irc::string x = text.c_str(); + this->ReplaceLine(x,pattern,irc::string(replace.c_str())); + text = x.c_str(); } } } -- cgit v1.2.3