X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FBadWords.pm;h=63ec8c881aa5e9db936ecc7fc3582f4577ce3e2d;hb=cc579a96816b0bae5b37dc132942fc1075449cf3;hp=e7d1169e3a390abd5845f5922bb299eaa79cefdc;hpb=17f0b57add792391822d38116e89b33c1df4e2dd;p=spider.git diff --git a/perl/BadWords.pm b/perl/BadWords.pm index e7d1169e..63ec8c88 100644 --- a/perl/BadWords.pm +++ b/perl/BadWords.pm @@ -56,7 +56,29 @@ sub load # check the text against the badwords list sub check { - return grep { $badword->in($_) } split(/\b/, lc shift); + my $s = uc shift; + + for (split(/\s+/, $s)) { + s/[^\w]//g; + return $_ if $badword->in($_); + s/\'?S$//; + return $_ if $badword->in($_); + } + + # look for a few of the common ones with spaces and stuff + if ($s =~ /F[\s\W]*U[\s\W]*C[\s\W]*K/) { + return "FUCK"; + } elsif ($s =~ /C[\s\W]*U[\s\W]*N[\s\W]*T/) { + return "CUNT"; + } elsif ($s =~ /W[\s\W]*A[\s\W]*N[\s\W]*K/) { + return "WANK"; + } elsif ($s =~ /C[\s\W]*[0O][\s\W]*C[\s\W]*K/) { + return "COCK"; + } elsif ($s =~ /S[\s\W]*H[\s\W]*[I1][\s\W]*T/) { + return "SHIT"; + } + + return (); } 1;