Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

message board filtering 1

Status
Not open for further replies.

myatia

Programmer
Nov 21, 2002
232
Hi,

I was just wondering if anyone knew of any custom tags that can filter message boards for offensive language. The things people post will be in a plain text, but I'm thinking that I probably will want to strip out any HTML tags they've placed in the message so they can't display pictures in their message or do anything else questionable. Does anyone know of a tag or tags that do these things? If you could pass the info along to me, I'd appreciate it!

Thanks,

Misty
 
You can do it with ColdFusion's built-in functions.

Code:
  <CFSET htmlFreeText = REReplace(rawBoardText,&quot;<[^>]*?>&quot;,&quot;&quot;,&quot;ALL&quot;)>
  <CFSET filteredText = ReplaceList(htmlFreeText,&quot;dirtyword1,dirtyword2,dirtyword3&quot;,&quot;****,****,****&quot;)>

The REReplace will do a regular expression search/replace to strip out all HTML tags. And the ReplaceList will replace all occurrances of &quot;dirtyword1&quot;, for example, with &quot;****&quot;.
Adjust and refine to fit your needs.


-Carl
 
As always, Carl, you're a godsend! Thanks for the info!

Misty
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top