I'm running an ASP chat application on the site I administer and it has a profanity filter that works along the the line of:
msgLine=Replace(msgline, "bugger", "b****er"
msgLine=Replace(msgline, "swine", "sw**ne"
.......but obviously with worse words than these
So as users get wise and start using "b.ugger" and "bu_gger" I will have to add new lines to the code to ban those words. What I'd like to do is kick them out if they swear - a solution has been suggested by a colleague:
if msgLine<>Replace(msgline, "bugger", "b****er"
then
msgLine=Replace(msgline, "bugger", "b****er"
Response.Redirect "swear.asp"
and this works but is going to prove unweidly and cumbersome if I have to use it for every bad word. Anyone got any suggestions on how to do it more elegantly? Treat me as an idiot when it comes to explaining as I am not a programmer by a long way!
msgLine=Replace(msgline, "bugger", "b****er"
msgLine=Replace(msgline, "swine", "sw**ne"
.......but obviously with worse words than these
So as users get wise and start using "b.ugger" and "bu_gger" I will have to add new lines to the code to ban those words. What I'd like to do is kick them out if they swear - a solution has been suggested by a colleague:
if msgLine<>Replace(msgline, "bugger", "b****er"
msgLine=Replace(msgline, "bugger", "b****er"
Response.Redirect "swear.asp"
and this works but is going to prove unweidly and cumbersome if I have to use it for every bad word. Anyone got any suggestions on how to do it more elegantly? Treat me as an idiot when it comes to explaining as I am not a programmer by a long way!