PHP Class HTMLPurifier, yii

显示文件 Open project: yiisoft/yii Class Usage Examples

Public Properties

Property Type Description
$config Global configuration object.
$context Is an array of contexts if the last called method was purifyArray().
$version Version of HTML Purifier.

Protected Properties

Property Type Description
$generator
$strategy

Public Methods

Method Description
__construct ( HTMLPurifier_Config | mixed $config = null ) Initializes the purifier.
addFilter ( HTMLPurifier_Filter $filter ) Adds a filter to process the output. First come first serve
getInstance ( HTMLPurifier | HTMLPurifier_Config $prototype = null ) : HTMLPurifier Singleton for enforcing just one HTML Purifier in your system
instance ( HTMLPurifier | HTMLPurifier_Config $prototype = null ) : HTMLPurifier Singleton for enforcing just one HTML Purifier in your system
purify ( string $html, HTMLPurifier_Config $config = null ) : string Filters an HTML snippet/document to be XSS-free and standards-compliant.
purifyArray ( string[] $array_of_html, HTMLPurifier_Config $config = null ) : string[] Filters an array of HTML snippets

Method Details

__construct() public method

Initializes the purifier.
public __construct ( HTMLPurifier_Config | mixed $config = null )
$config HTMLPurifier_Config | mixed Optional HTMLPurifier_Config object for all instances of the purifier, if omitted, a default configuration is supplied (which can be overridden on a per-use basis). The parameter can also be any type that HTMLPurifier_Config::create() supports.

addFilter() public method

Adds a filter to process the output. First come first serve
public addFilter ( HTMLPurifier_Filter $filter )
$filter HTMLPurifier_Filter HTMLPurifier_Filter object

getInstance() public static method

Singleton for enforcing just one HTML Purifier in your system
public static getInstance ( HTMLPurifier | HTMLPurifier_Config $prototype = null ) : HTMLPurifier
$prototype HTMLPurifier | HTMLPurifier_Config Optional prototype HTMLPurifier instance to overload singleton with, or HTMLPurifier_Config instance to configure the generated version with.
return HTMLPurifier

instance() public static method

Singleton for enforcing just one HTML Purifier in your system
public static instance ( HTMLPurifier | HTMLPurifier_Config $prototype = null ) : HTMLPurifier
$prototype HTMLPurifier | HTMLPurifier_Config Optional prototype HTMLPurifier instance to overload singleton with, or HTMLPurifier_Config instance to configure the generated version with.
return HTMLPurifier

purify() public method

Filters an HTML snippet/document to be XSS-free and standards-compliant.
public purify ( string $html, HTMLPurifier_Config $config = null ) : string
$html string String of HTML to purify
$config HTMLPurifier_Config Config object for this operation, if omitted, defaults to the config object specified during this object's construction. The parameter can also be any type that HTMLPurifier_Config::create() supports.
return string Purified HTML

purifyArray() public method

Filters an array of HTML snippets
public purifyArray ( string[] $array_of_html, HTMLPurifier_Config $config = null ) : string[]
$array_of_html string[] Array of html snippets
$config HTMLPurifier_Config Optional config object for this operation. See HTMLPurifier::purify() for more details.
return string[] Array of purified HTML

Property Details

$config public_oe property

Global configuration object.
public $config

$context public_oe property

Is an array of contexts if the last called method was purifyArray().
public $context

$generator protected_oe property

protected $generator

$strategy protected_oe property

protected $strategy

$version public_oe property

Version of HTML Purifier.
public $version