Blacklist filter
I create a black list filter for a search site with this code:
<!--- blacklist function --->
<cffunction name="checkWord" returntype="boolean">
<cfargument name="word" type="string">
<cfset var i="">
<cfif word is not "">
<cfloop index="i" list="#blacklist#" delimiters="|">
<cfif findNoCase(i,word) gt 0>
<!--- denied word --->
<cfreturn false>
</cfif>
</cfloop>
</cfif>
<cfreturn true>
</cffunction>
Blacklist is a string (list) with many denied word like: "porn|sex|masturb|...".
Script is not so fast, how may I optimize it?
Thanks.
Merlinox
