> <cfloop query="getprofanities">
>
>       <cfset newlist = ReplaceNoCase(bodytext, "getprofanities.badword",
> "getprofanities.rate1", "ALL")>
>
> </cfloop>

One mistake is the use of quotes. In a function, if you do Function("foo"),
foo is a string. But you want to use the value of getprofanities.badword, so
you don't use the quotes. Try rewriting it like so:

        <cfset newlist = ReplaceNoCase(bodytext,
getprofanities.badword,getprofanities.rate1, "ALL")>

You also don't need the getprofanities. in front of badword and rate1. Since
you are looping over the query, it is implied.

Another thing you may want to look out. Consider the case where Clinton is
the bad word. What happens if I do:

C l i n t o n

Your checker won't find that word. What I've done in the past is to take the
bad word and translate it into a regex that looks like this:

C[[:space:]]l[[:space:]]etc

This will make it match the test above. You would also change ReplaceNoCase
w/ REReplaceNoCase.

=======================================================================
Raymond Camden, Principal Spectra Compliance Engineer for Macromedia

Email   : [EMAIL PROTECTED]
ICQ UIN : 3679482

"My ally is the Force, and a powerful ally it is." - Yoda


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to