Class HTMLPurifier
Facade that coordinates HTML Purifier's subsystems in order to purify
HTML.
Note:
There are several points in which configuration can be specified for HTML
Purifier. The precedence of these (from lowest to highest) is as follows: -#
Instance: new HTMLPurifier($config) -# Invocation: purify($html, $config) These
configurations are entirely independent of each other and are
not
merged (this behavior may change in the future).
Located at xoops_trust_path/libs/htmlpurifier/library/HTMLPurifier.php
Methods summary
public
|
#
__construct( $config $config = null )
Initializes the purifier.
Initializes the purifier.
Parameters
- $config
$config 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.
|
public
|
#
addFilter( $filter $filter )
Adds a filter to process the output. First come first serve
Adds a filter to process the output. First come first serve
Parameters
- $filter
$filter HTMLPurifier_Filter object
|
public
Purified
|
#
purify( $html $html, $config $config = null )
Filters an HTML snippet/document to be XSS-free and standards-compliant.
Filters an HTML snippet/document to be XSS-free and standards-compliant.
Parameters
- $html
$html String of HTML to purify
- $config
$config HTMLPurifier_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.
Returns
Purified HTML
|
public
Array
|
#
purifyArray( $config $array_of_html, $config = null )
Filters an array of HTML snippets
Filters an array of HTML snippets
Parameters
- $array_of_html
$config Optional HTMLPurifier_Config object for this operation. See
HTMLPurifier::purify() for more details.
- $config
Returns
Array of purified HTML
|
public static
|
#
instance( $prototype $prototype = null )
Singleton for enforcing just one HTML Purifier in your system
Singleton for enforcing just one HTML Purifier in your system
Parameters
- $prototype
$prototype Optional prototype HTMLPurifier instance to overload singleton with, or
HTMLPurifier_Config instance to configure the generated version with.
|
public static
|
#
getInstance( $prototype = null )
Note
Backwards compatibility, see instance()
|
Constants summary
string
|
VERSION
|
'4.3.0' |
#
Constant with version of HTML Purifier
Constant with version of HTML Purifier
|
Properties summary
public
string
|
$version
|
'4.3.0' |
|
public
|
$config
|
|
#
Global configuration object
Global configuration object
|
protected
|
$strategy
|
|
|
protected
|
$generator
|
|
|
public
|
$context
|
|
#
Resultant HTMLPurifier_Context of last run purification. Is an array of
contexts if the last called method was purifyArray().
Resultant HTMLPurifier_Context of last run purification. Is an array of
contexts if the last called method was purifyArray().
|