PHPBuilder - 'Bad word' Function



RSS Twitter
Snippets Algorithms

'Bad word' Function

by: Nick Wilson
|
March 15, 2001

Version: 1.3

Type: Function

Category: Algorithms

License: GNU General Public License

Description: A little function that checks a string for 'bad words'.



<?
//*****************************************************
//****** Bad_word Function                      *******
//****** Function to check for rude words etc   *******
//****** in a given string.                     *******
//****** It can easily be broken if a user is   *******
//****** determined but should deter the        *******
//****** average vandal!                        *******
//****** Please send any suggestions for        *******
//****** additional words to nwilson@mail.dk    *******
//*****************************************************

function bad_word ($intext) {
$check= eregi("fuc?k|[kc]unt|ar[zs]e?hole?|a[sz]?[zs]hole?|face$|pi[zs]?[zs]|shit|wank|pric?k|to[zs]?[sz]er|vagina|vaginer|pu[zs]?[zs][yi]|breath|mo?oke?[iy]|stink|bit?ch|bar?[sz]tar?d|s[kc]rew|bal?l[sz]|bol?lo[kc]?[ck][zs]|gonads?|idiot|mole[zs]ter|mole[sz]t|pen[iu][sz]|anu[sz]|coc?k|horrible|dirty?|filthy?|dic?k|head$|slime|kille[rd]|puke|vomit|suck|spastic|spaz|bugg?ery?|(you )|( you )|(u )|( u )|( of?f$)|( of?f )|[asz]{3,}", $intext);

if ($check) { 
	return TRUE;
	exit; 
	} else { return FALSE;
		}

}

?>

Comment and Contribute

Your comment has been submitted and is pending approval.

Author:
Nick Wilson

Comment:



Comment:

(Maximum characters: 1200). You have characters left.