preserveSingleQuotes

Prevents CFML from automatically escaping single quotation mark characters that are contained in a variable. CFML does not evaluate the argument.

preserveSingleQuotes(variable) → returns void

Discouraged: The use of preserveSingleQuotes often (but not always) results in code that will be vulnerable to SQL Injection. Use the cfqueryparam tag instead, and you will not need to worry about single quotes.

Argument Reference

variable string
Required

Variable that contains a string in which to preserve single quotation marks.

Examples
Sample code invoking the preserveSingleQuotes function

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub