Re: Re: Form Data Filtering

From: Date: Fri, 15 Jun 2007 14:57:22 +0000
Subject: Re: Re: Form Data Filtering
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-257084@lists.php.net to get a copy of this message
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@dontjustsitthere.co.uk'); > } > } > } > > // 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@dontjustsitthere.co.uk'); > } > } > } and you get 1000 emails if I paste 'fuck' 1000 times into your comment box? ;) greets Zoltán Németh

« previous php.general (#257084) next »