Here's the way that I do it, if you're interested:

<!--- do any of the form fields for comments have these words in them? --->
<cfset VARIABLES.disallowedTerms =
ListToArray('cigar,tarwar,fuzye,ezdwo,natup')>

<!--- sanitize input fields, checking for comment spam --->
<cfloop list="link,comment,visitor" index="field">
        <cfloop index="i" array="#VARIABLES.disallowedTerms#">
                <cfif FindNoCase(i,FORM[field])>
                        <cfset VARIABLES.allowPost = false>
                        <cfbreak>
                </cfif>
        </cfloop>
</cfloop> 

-----Original Message-----
From: Ryan J. Heldt [mailto:[EMAIL PROTECTED] 
Sent: Monday, October 20, 2008 8:47 AM
To: cf-talk
Subject: Re: Obscenity/Bad Words filter udf/cfc?

Dan-

I don't have any code for this, but what I would do is take a block of text
and treat it as a list, using space, CFLF, and other characters as needed as
delimiters. Then loop though the list and see if any of those are in a
struct or array of "dirty words" you have. I *think* Camden's Blog CFC has
something like this, but I could be wrong. Either way, it should take very
long to implement.

Thanks!
Ryan

*Ryan J. Heldt*, Senior Web Developer
Global Reach Internet Productions
http://www.globalreach.com
Phone: 515-296-0792, Fax: 515-296-3748


Dan O'Keefe wrote:
> Has anyone come across any others? Need one with "whole word" support.
>
> Dan
>
>
>
> On Sat, Mar 10, 2007 at 3:04 PM, Matt Quackenbush <[EMAIL PROTECTED]>
wrote:
>   
>> There's also one at CFlib.org.
>>
>> http://www.cflib.org/udf.cfm?ID=1105
>>
>>
>>
>>     
>
> 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:314134
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to