Hire Me! I'm currently looking for my next role in developer relations and advocacy. If you've got an open role and think I'd be a fit, please reach out. You can also find me on LinkedIn.

Ben Forta pointed out an issue with my blog where comments with single quotes were ending up doubled. Why? As you know, CF will auto-escape single quotes in string values passed to a database with cfquery. In this case, I was passing in values with the queryParam custom tag. (This makes your queries faster and safer - if you aren't using it yet - you should be.) Anyway, there is an issue where if you pass in a value along with a string function, the queryParam tag will double the double so to speak. So, this will lead to incorrect results:

<cfset foo = "here's looking">
<cfquery datasource="camdenblog">
...
<cfqueryparam value="#htmlEditFormat(foo)#" cfsqltype="CF_SQL_LONGVARCHAR">
...
</cfquery>

To fix this, you simply move the string call outside the queryparam, ie:

<cfset foo = htmlEditFormat(...)>