Scriptlog Docs

Scriptlog Documentation

Code reference for the Scriptlog codebase

User Tools

Site Tools


scriptlog:lib:core:htmlpurifier

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
scriptlog:lib:core:htmlpurifier [2026/09/26 09:09] – admin adminscriptlog:lib:core:htmlpurifier [2026/09/26 09:43] (current) – admin admin
Line 1: Line 1:
-====== HTMLPurifier ====== 
- 
-**Layer:** ''Core'' · **Source:** ''lib/core/HTMLPurifier.php:54'' (lines 54–296) 
- 
----- 
-<code> 
-class HTMLPurifier 
-</code> 
- 
-Facade that coordinates HTML Purifier's subsystems in order to purify HTML. 
- 
-======= Docblock Metadata ======= 
- 
-  ^ Tag ^ Value ^ 
-  | ''@todo'' | We need an easier way to inject strategies using the configuration object. | 
- 
-======= TODO ======= 
- 
-  * We need an easier way to inject strategies using the configuration object. 
- 
-======= Inheritance ======= 
- 
-//No parent, interface or trait. This is a root type.// 
- 
-======= Constants (1) ======= 
- 
-  ^ Visibility ^ Name ^ Value ^ Line ^ 
-  | ''-'' | ''VERSION'' | '''4.15.0';'' | 65 | 
- 
-======= Properties (2) ======= 
- 
-  ^ Visibility ^ Type ^ Name ^ Default ^ Line ^ 
-  | ''public'' | ''(untyped)'' | ''$version'' | '''4.15.0';'' | 60 | 
-  | ''private'' | ''(untyped)'' | ''$filters'' | ''array();'' | 78 | 
- 
-======= Methods (6) ======= 
- 
-  ^ Visibility ^ Method ^ Summary ^ Line ^ 
-  | public | ''__construct()'' | Initializes the purifier. | 113 | 
-  | public | ''addFilter()'' | Adds a filter to process the output. First come first serve | 124 | 
-  | public | ''purify()'' | Filters an HTML snippet/document to be XSS-free and standards-compliant. | 145 | 
-  | public | ''purifyArray()'' | Filters an array of HTML snippets | 239 | 
-  | public static | ''instance()'' | Singleton for enforcing just one HTML Purifier in your system | 267 | 
-  | public static | ''getInstance()'' | Singleton for enforcing just one HTML Purifier in your system | 292 | 
- 
- 
-======== __construct() ======== 
- 
-<code> 
-public function __construct($config = null) 
-</code> 
- 
-//lines 113–117 (5)// 
- 
-Initializes the purifier. 
- 
-  ^ Parameter ^ Type ^ Default ^ Description ^ 
-  | ''$config'' | ''(untyped)'' | ''null'' | 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 ba… | 
- 
- 
-======== addFilter() ======== 
- 
-<code> 
-public function addFilter($filter) 
-</code> 
- 
-//lines 124–132 (9)// 
- 
-Adds a filter to process the output. First come first serve 
- 
-  ^ Parameter ^ Type ^ Default ^ Description ^ 
-  | ''$filter'' | ''(untyped)'' | //required// | HTMLPurifier_Filter object | 
- 
-**Returns:** ''(none declared)'' 
- 
- 
-======== purify() ======== 
- 
-<code> 
-public function purify($html, $config = null) 
-</code> 
- 
-//lines 145–228 (84)// 
- 
-Filters an HTML snippet/document to be XSS-free and standards-compliant. 
- 
-  ^ Parameter ^ Type ^ Default ^ Description ^ 
-  | ''$html'' | ''(untyped)'' | //required// | String of HTML to purify | 
-  | ''$config'' | ''(untyped)'' | ''null'' | 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 tha… | 
- 
-**Returns:** ''(none declared)'' — string Purified HTML 
- 
- 
-======== purifyArray() ======== 
- 
-<code> 
-public function purifyArray($array_of_html, $config = null) 
-</code> 
- 
-//lines 239–254 (16)// 
- 
-Filters an array of HTML snippets 
- 
-  ^ Parameter ^ Type ^ Default ^ Description ^ 
-  | ''$array_of_html'' | ''(untyped)'' | //required// | Array of html snippets | 
-  | ''$config'' | ''(untyped)'' | ''null'' | Optional config object for this operation. See HTMLPurifier::purify() for more details. | 
- 
-**Returns:** ''(none declared)'' — string[] Array of purified HTML 
- 
- 
-======== instance() ======== 
- 
-<code> 
-public static function instance($prototype = null) 
-</code> 
- 
-//lines 267–279 (13)// 
- 
-Singleton for enforcing just one HTML Purifier in your system 
- 
-  ^ Parameter ^ Type ^ Default ^ Description ^ 
-  | ''$prototype'' | ''(untyped)'' | ''null'' | Optional prototype HTMLPurifier instance to overload singleton with, or HTMLPurifier_Config instance to configure the generated version with. | 
- 
-**Returns:** ''(none declared)'' — HTMLPurifier 
- 
- 
-======== getInstance() ======== 
- 
-<code> 
-public static function getInstance($prototype = null) 
-</code> 
- 
-//lines 292–295 (4)// 
- 
-Singleton for enforcing just one HTML Purifier in your system 
- 
-  ^ Parameter ^ Type ^ Default ^ Description ^ 
-  | ''$prototype'' | ''(untyped)'' | ''null'' | Optional prototype HTMLPurifier instance to overload singleton with, or HTMLPurifier_Config instance to configure the generated version with. | 
- 
-**Returns:** ''(none declared)'' — HTMLPurifier 
- 
- 
----- 
- 
-//This page is generated from source by 'tools/gendoc'. Edits will be overwritten.// 
  
scriptlog/lib/core/htmlpurifier.1790413762.txt.gz · Last modified: by admin