mirror of
https://github.com/anope/anope.git
synced 2026-07-07 20:43:14 +02:00
BUILD : 1.7.7 (540) BUGS : 277 NOTES : BotServ Badwords (START) would return a false positivie when BSCaseSensitive is enabled
git-svn-id: svn://svn.anope.org/anope/trunk@540 31f1291d-b8d6-0310-a050-a5561fc1590b git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@393 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
parent
a3d993d02c
commit
bafd62e477
+18
-15
@@ -295,7 +295,7 @@ void botchanmsgs(User * u, ChannelInfo * ci, char *buf)
|
||||
} else if (bw->type == BW_SINGLE) {
|
||||
int len = strlen(bw->word);
|
||||
|
||||
if ((BSCaseSensitive && strstr(nbuf, bw->word))
|
||||
if ((BSCaseSensitive && !strcmp(nbuf, bw->word))
|
||||
|| (!BSCaseSensitive
|
||||
&& (!stricmp(nbuf, bw->word)))) {
|
||||
mustkick = 1;
|
||||
@@ -303,12 +303,12 @@ void botchanmsgs(User * u, ChannelInfo * ci, char *buf)
|
||||
} else if ((strchr(nbuf, ' ') == nbuf + len)
|
||||
&&
|
||||
((BSCaseSensitive
|
||||
&& (strstr(nbuf, bw->word) == nbuf))
|
||||
&& !strcmp(nbuf, bw->word))
|
||||
|| (!BSCaseSensitive
|
||||
&& (stristr(nbuf, bw->word) ==
|
||||
nbuf)))) {
|
||||
mustkick = 1;
|
||||
} else
|
||||
} else {
|
||||
if ((strrchr(nbuf, ' ') ==
|
||||
nbuf + strlen(nbuf) - len - 1)
|
||||
&&
|
||||
@@ -318,19 +318,22 @@ void botchanmsgs(User * u, ChannelInfo * ci, char *buf)
|
||||
|| (!BSCaseSensitive
|
||||
&& (stristr(nbuf, bw->word) ==
|
||||
nbuf + strlen(nbuf) - len)))) {
|
||||
mustkick = 1;
|
||||
} else {
|
||||
char *wordbuf = scalloc(len + 3, 1);
|
||||
|
||||
wordbuf[0] = ' ';
|
||||
wordbuf[len + 1] = ' ';
|
||||
wordbuf[len + 2] = '\0';
|
||||
memcpy(wordbuf + 1, bw->word, len);
|
||||
|
||||
if ((BSCaseSensitive && (strstr(nbuf, wordbuf)))
|
||||
|| (!BSCaseSensitive
|
||||
&& (stristr(nbuf, wordbuf))))
|
||||
mustkick = 1;
|
||||
} else {
|
||||
char *wordbuf = scalloc(len + 3, 1);
|
||||
|
||||
wordbuf[0] = ' ';
|
||||
wordbuf[len + 1] = ' ';
|
||||
wordbuf[len + 2] = '\0';
|
||||
memcpy(wordbuf + 1, bw->word, len);
|
||||
|
||||
if ((BSCaseSensitive
|
||||
&& (strstr(nbuf, wordbuf)))
|
||||
|| (!BSCaseSensitive
|
||||
&& (stristr(nbuf, wordbuf)))) {
|
||||
mustkick = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (bw->type == BW_START) {
|
||||
int len = strlen(bw->word);
|
||||
|
||||
Reference in New Issue
Block a user