Re: bad word filter
| From: | Tyler Longren | Date: | Tue, 24 Jul 2001 19:31:47 +0000 |
| Subject: | Re: bad word filter | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-59408@lists.php.net to get a copy of this message | ||
That is a very good idea. I had never even thought of doing it that way.
Perhaps I will talk with them about it.
Tyler Longren
Captain Jack Communications
tyler@captainjack.com
www.captainjack.com
----- Original Message -----
From: "Philip Hallstrom" <philip@adhesivemedia.com>
To: "Tyler Longren" <tyler@captainjack.com>
Cc: "Ryan Fischer" <ryan@gigabee.com>; "php-general"
<php-general@lists.php.net>
Sent: Tuesday, July 24, 2001 2:30 PM
Subject: Re: bad word filter
> I missed the first part of this, but I'm assuming it's for a message board
> of some sort? Why not implement a "big brother" system where other
> posters can indicate that the post contains inappropriate content. If
> enough people do this, then just kill the post, and record the author. If
> enough of an author's posts get killed, then ban the author.
>
> That would be a lot more useful, a lot more fun to do, and you'd get more
> $$ from your clients :)
>
> On Tue, 24 Jul 2001, Tyler Longren wrote:
>
> > I waste my time because the clients pay me to. ;-)
> > They get what they want. I told them there would very easy ways around
the
> > filters. but they insisted.....
> >
> > Thanks!
> > Tyler Longren
> > Captain Jack Communications
> > tyler@captainjack.com
> > www.captainjack.com
> >
> >
> > ----- Original Message -----
> > From: "Ryan Fischer" <ryan@gigabee.com>
> > To: "Tyler Longren" <tyler@captainjack.com>; "php-general"
> > <php-general@lists.php.net>
> > Sent: Tuesday, July 24, 2001 2:27 PM
> > Subject: Re: bad word filter
> >
> >
> > > You wrote:
> > > > I've been reading the "Profanity Filter" thread in the list
> > > > archives
> > > but
> > > > haven't found anything real helpful. Here's my code so far, this of
> > > course
> > > > won't work.
> > > > <?
> > > > function filterWords($string, &$result) {
> > > > $badwords="shit, fuck, ass, bitch";
> > > > $word=explode(", ", $badwords);
> > > > for ($i=0; $i<count($word); $i++) {
> > > > $replace = str_replace("$word[$i]", "****",
$string);
> > > > }
> > > > }
> > > > $string = "Ass monkey";
> > > > filterWords("$string", $result);
> > > > print "$result";
> > > > ?>
> > > >
> > > > How can I scan for the $badwords in $string and replace $badwords
with
> > > ****?
> > >
> > > Why waste your time? People will find a way around the filters
anyway,
> > > if they really want to use the words you're censoring. Just a point
to
> > > be made.
> > >
> > > Anyway, here's what I would do:
> > >
> > > function filterWords($str){
> > > $badwords = array("shit", "fuck", "ass",
> > > "bitch");
> > > for($i=0; $i<count($badwords); $i++){
> > > $str = $eregi_replace("$badwords[$i]", "*****", $str);
> > > }
> > > return $str;
> > > }
> > > $str = filterWords("Ass monkey");
> > > print $str; // Prints "***** monkey"
> > >
> > > If you want to get really fancy, you can replace the "*****" with some
> > > function calculating just how many asterisks you need to censor out
the
> > > current word for its length. HTH. :)
> > >
> > > --
> > > -Ryan :: ICQ - 595003 :: GigaBoard -
> > > http://www.gigaboard.net/
> > >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> > For additional commands, e-mail: php-general-help@lists.php.net
> > To contact the list administrators, e-mail: php-list-admin@lists.php.net
> >
>