Copy link to clipboard
Copied
I started working on a website that pulls information from another websites database. The issue I have is the users are entering in content which breaks the whole site. There are so many users that I can't tell them all to avoid special characters. Is there any to tell ColdFusion to ingore special characters, or to read the information as just text.
Copy link to clipboard
Copied
This situation is what the various "format" functions are for. HTMLEditFormat(), HTMLCodeFormat(), urlEncodedFormat(), XMLFormat() etc. Use the appropiate one(s) for your needs.
Copy link to clipboard
Copied
In addition to using the functions ilssac mentioned you might search the user defined functions posted at http://www.cflib.org/ .
You will find functions for:
1. Removing HTML: http://www.cflib.org/udf/stripHTML
2. Converting Microsoft Word smart quote characters to standard quotes: http://www.cflib.org/udf/ConvertSpecialChars
It might be helpful to know what you mean by "special characters".
Copy link to clipboard
Copied
I am not entirely sure what actually broke the web page. What is being entered are just comments, nothing complicated. One post will break the web page and if you remove all quotes and punctuation that same post will work no problem.
Copy link to clipboard
Copied
If the text is being copied from Microsoft Word the problem might be that single and double quotes in Word (AKA 'smart quotes') are not standard ASCII characters. You should be able to find a function at cflib.org that can find and replace these characters.