Re: Re: Form Data Filtering

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2007. 06. 15, péntek keltezéssel 15.48-kor Dave Goodchild ezt írta:
> I use something like this:
> 
> $_SESSION['profane'] = false;
> 
>     foreach ($_POST as $value) {
>         foreach ($swearbox as $profanity) {
>             if (preg_match("/$profanity/i", $value)) {
>             $errors = true;
>             $_SESSION['profane'] = true;
>             mail(TECHEMAIL, 'profane content attack attempt on DJST', "Word:
> $value From: {$_SERVER['REMOTE_ADDRESS']} Time: " . date('d F Y G:i:s',
> time()-TIMEDIFF), 'whoops@xxxxxxxxxxxxxxxxxxxxxx');
>             }
>         }
>     }
> 
> // second pass - words that are offensive in isolation but could be part of
> acceptable words above
> 
>     foreach ($_POST as $value) {
>         foreach ($refined_swearbox as $profanity) {
>             if (preg_match("/\b$profanity\b/i", $value)) {
>             $errors = true;
>             $_SESSION['profane'] = true;
>             mail(TECHEMAIL, 'profane content attack attempt on DJST', "Word:
> $value From: {$_SERVER['REMOTE_ADDRESS']} Time: " . date('d F Y G:i:s',
> time()-TIMEDIFF), 'whoops@xxxxxxxxxxxxxxxxxxxxxx');
>             }
>         }
>     }


and you get 1000 emails if I paste 'fuck' 1000 times into your comment
box? ;)

greets
Zoltán Németh

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux