summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-04-25 15:38:10 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-04-25 15:38:10 +0000
commitd21798d24e62b8afbb1e9e0d776192ef30f099e7 (patch)
treefb3eda0e4ec19731a98ddcd35b7ee8bc1c858837 /src
parent9e9a13dc28025d4649df7b971ecf2c85a3495d72 (diff)
Removed dependency upon strcasestr()
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1185 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/modules/m_chanfilter.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/modules/m_chanfilter.cpp b/src/modules/m_chanfilter.cpp
index 24cec2b99..3f343202c 100644
--- a/src/modules/m_chanfilter.cpp
+++ b/src/modules/m_chanfilter.cpp
@@ -84,12 +84,16 @@ class ModuleChanFilter : public Module
virtual int ProcessMessages(userrec* user,chanrec* chan,std::string &text)
{
+ char buffer[MAXBUF];
+ strlcpy(buffer,text.c_str(),MAXBUF);
+ for (int j = 0; j < strlen(buffer); j++)
+ buffer[j] = tolower(buffer[j]);
SpamList* spamlist = (SpamList*)chan->GetExt("spam_list");
if (spamlist)
{
for (SpamList::iterator i = spamlist->begin(); i != spamlist->end(); i++)
{
- if (strcasestr(text.c_str(),i->c_str()))
+ if (strstr(text.c_str(),i->c_str()))
{
WriteServ(user->fd,"936 %s %s :Your message contained a censored word, and was blocked",user->nick, chan->name);
return 1;
@@ -122,6 +126,10 @@ class ModuleChanFilter : public Module
if ((modechar == 'g') && (type == MT_CHANNEL))
{
chanrec* chan = (chanrec*)target;
+
+ for (int j = 0; j < strlen(params[0]); j++)
+ params[0][j] = tolower(params[0][j]);
+
std::string param = params[0];
if (mode_on)