getSafeHTML
Sanitizes HTML using antisamy policy rules.
getSafeHTML(inputString [, PolicyFile, throwOnError]) → returns any
Argument Reference
inputString string Required
String to be sanitized
PolicyFile string
File path for custom antisamy policy file. Can be defined in the application scope or if not defined will use ColdFusion server default
Compatibility
BoxLang:
Version 1.0.0+ Requires the
bx-esapi module. Links more information about getSafeHTML
- OWASP antisamy - AntiSamy OWASP Project page
- Google Code for AntiSamy
Examples Sample code invoking the getSafeHTML function
AntiSamy parameter can be set in the application scope
<cfcomponent>
<cfset this.security.antisamypolicy = "antisamy.xml">
</cfcomponent> demonstrates usage
<cfset SafeHTML = getSafeHTML(inputHTML, "", true)>
© 2012–present Foundeo, Inc. and the CFDocs contributors.
Licensed under the MIT License.
ColdFusion is a trademark of Adobe Systems Incorporated.
https://cfdocs.org/getsafehtml