i have a censoring routine that contains the following lines:
foreach $dirty_word (@dirty_words) {
if (lc($in{$col}) =~ /$dirty_word/) {
....
$in{$col} is the form input
if i enter shitake (mushroom), it rejects the value because it is matching shit. i have tried multiple things and none work. i'm sure it must be something simple but i can't figure it out. please help.
Code:
@dirty_words = ('fuck','shit','cocksucker','asshole','cunt','pussy','tits','bastard','bitch','piss','darksites','myrealbox','penis','cialis','viagra'); foreach $dirty_word (@dirty_words) {
if (lc($in{$col}) =~ /$dirty_word/) {
....
$in{$col} is the form input
if i enter shitake (mushroom), it rejects the value because it is matching shit. i have tried multiple things and none work. i'm sure it must be something simple but i can't figure it out. please help.