eXtropia: the open web technology company
Technology | Support | Tutorials | Development | About Us | Users | Contact Us
Development resources
 ::   WebWare 2.1 (Perl)
 ::   WebWare 2.0 (Java)
 ::   Cool hacks
radical hacks
WebChat Bad Word Filter  
sent in the following hack:

Just thought I'd pass along a bad word filter I added.

In chat.cgi, add this code to the sub "HtmlFilter", near the end of the script. Just before "$filter;", add this code:

open(BW, "badwords.txt");
   @badwords = grep(!/^#/,<BW>);

foreach $badword (@badwords){
	$filter=~ s/$badword/\#\#\#\#/ig;

Then, place a file called "badwords.txt" within your main chat directory; one word per line, with the longer words first.
Brad ----------------------------------------