#native_company# #native_desc#
#native_cta#

‘Bad word’ Function

By Nick Wilson
on 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 [email protected]    *******
//*****************************************************

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;
		}

}

?>