Class HTMLPurifier
Inheritance | HTMLPurifier |
---|
Facade that coordinates HTML Purifier's subsystems in order to purify HTML.
Public Properties
Property | Type | Description | Defined By |
---|---|---|---|
$config | Global configuration object. | HTMLPurifier | |
$context | Resultant context of last run purification. | HTMLPurifier | |
$version | Version of HTML Purifier. | HTMLPurifier |
Protected Properties
Property | Type | Description | Defined By |
---|---|---|---|
$generator | HTMLPurifier | ||
$strategy | HTMLPurifier |
Public Methods
Method | Description | Defined By |
---|---|---|
__construct() | Initializes the purifier. | HTMLPurifier |
addFilter() | Adds a filter to process the output. First come first serve | HTMLPurifier |
getInstance() | Singleton for enforcing just one HTML Purifier in your system | HTMLPurifier |
instance() | Singleton for enforcing just one HTML Purifier in your system | HTMLPurifier |
purify() | Filters an HTML snippet/document to be XSS-free and standards-compliant. | HTMLPurifier |
purifyArray() | Filters an array of HTML snippets | HTMLPurifier |
Constants
Constant | Value | Description | Defined By |
---|---|---|---|
VERSION | '4.6.0' | Constant with version of HTML Purifier. | HTMLPurifier |
Property Details
Is an array of contexts if the last called method was purifyArray().
Method Details
Initializes the purifier.
public void __construct ( $config = null ) | ||
$config | HTMLPurifier_Config | Optional HTMLPurifier_Config object
|
Adds a filter to process the output. First come first serve
public void addFilter ( $filter ) | ||
$filter | HTMLPurifier_Filter | HTMLPurifier_Filter object |
Singleton for enforcing just one HTML Purifier in your system
public static HTMLPurifier getInstance ( $prototype = null ) | ||
$prototype | HTMLPurifier|HTMLPurifier_Config | Optional prototype
|
Singleton for enforcing just one HTML Purifier in your system
public static HTMLPurifier instance ( $prototype = null ) | ||
$prototype | HTMLPurifier|HTMLPurifier_Config | Optional prototype
|
Filters an HTML snippet/document to be XSS-free and standards-compliant.
public string purify ( $html, $config = null ) | ||
$html | string | String of HTML to purify |
$config | HTMLPurifier_Config | Config object for this operation,
|
return | string | Purified HTML |
---|
Filters an array of HTML snippets
public string[] purifyArray ( $array_of_html, $config = null ) | ||
$array_of_html | string[] | Array of html snippets |
$config | HTMLPurifier_Config | Optional config object for this operation.
|
return | string[] | Array of purified HTML |
---|