Sanitizes HTML using antisamy policy rules.
getSafeHTML(inputString [, PolicyFile, throwOnError])
returns any
Name | Type | Required | Default | Description |
---|---|---|---|---|
inputString | string | Yes | String to be sanitized | |
PolicyFile | string | No | File path for custom antisamy policy file. Can be defined in the application scope or if not defined will use ColdFusion server default | |
throwOnError | boolean | No | If true will throw error else empty string will be returned |
AntiSamy parameter can be set in the application scope
<cfcomponent>
<cfset this.security.antisamypolicy = "antisamy.xml">
</cfcomponent>
demonstrates usage
<cfset SafeHTML = getSafeHTML(inputHTML, "", true)>