Spec-Zone.ru › ColdFusion

getSafeHTML

Sanitizes HTML using antisamy policy rules.

getSafeHTML(inputString [, PolicyFile, throwOnError]) → returns any

  • CF11+
  • BL 1.0.0+
  • See Also: isSafeHTML

    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

    throwOnError boolean

    If true will throw error else empty string will be returned

    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

    application setting demo

    AntiSamy parameter can be set in the application scope

    
    <cfcomponent>
      <cfset this.security.antisamypolicy = "antisamy.xml">
    </cfcomponent>

    Usage

    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

    Spec-Zone.ru

    Настройки Оффлайн Что нового Помощь О нас
    Spec-Zone .ru
    спецификации, руководства, описания, API