Re: Swear filter ideas
| From: | Robert Cummings | Date: | Thu, 28 Jun 2007 13:11:07 +0000 |
| Subject: | Re: Swear filter ideas | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-257908@lists.php.net to get a copy of this message | ||
On Thu, 2007-06-28 at 12:35 +0200, Tijnema wrote:
> On 6/28/07, Richard Davey <rich@corephp.co.uk> wrote:
> > Hi all,
> >
> > Just wanting to pick your collective brains on this one:
> >
> > How do you go about implementing a swear / bad-word filter in PHP?
> >
> > Reasons for needing one aside, I'm just wondering if you favour a
> > regexp, a substr_count, or what? Do you like to *** out the bad words,
> > or just error back to the user? (I guess that is application
> > specific).
> >
> > There are always ways to circumvent them, but I'm still curious to
> > know how you prefer to handle it.
> >
> > Cheers,
> >
> > Rich
>
> This is a really though thing to implement, let's say you don't want
> to the word "ass" in your message coming from the user, and the
> message contains this:
>
> Hi, in the archive I attached is a picture of my ass, the password is abcdef.
>
> The word ass is not wanted, so you *** it, but if you do that with a
> regexp or such, then password would become p***word, or you want to
> check only for real words (so spaces on both sides), but then somebody
> would write !ass! or something like that.
You got a problem with beasts of burden?
:)
Cheers,
Rob
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com
|
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'