Created
October 13, 2012 01:45
-
-
Save stevereich/3882872 to your computer and use it in GitHub Desktop.
Coldfusion handler for bad words filter.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
if(structkeyexists(form, "filterBox")){ | |
variables.checkString = form.filterBox; | |
if(structKeyexists(form, "replaceString")){ | |
if(form.replaceString EQ "0"){ | |
variables.cleanText = application.filters.filterWords(variables.checkString,0); | |
} | |
else{ | |
variables.cleanText = application.filters.filterWords(variables.checkString,1); | |
} | |
} | |
else{ | |
variables.cleanText = application.filters.filterWords(variables.checkString,0); | |
} | |
variables.cleanText = serializejson(variables.cleanText); | |
writeoutput(variables.cleanText); | |
} | |
else{ | |
location(url="wordFilter.cfm",addtoken=false); | |
} | |
</cfscript> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment