Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 3.9.x will end* 10 May 2021 (12 months).
  • Bug fixes for security issues in 3.9.x will end* 8 May 2023 (36 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Differences Between: [Versions 39 and 311] [Versions 39 and 400] [Versions 39 and 401] [Versions 39 and 402] [Versions 39 and 403]

(no description)

File Size: 296 lines (10 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

HTMLPurifier:: (6 methods):
  __construct()
  addFilter()
  purify()
  purifyArray()
  instance()
  getInstance()


Class: HTMLPurifier  - X-Ref

Facade that coordinates HTML Purifier's subsystems in order to purify HTML.

__construct($config = null)   X-Ref
Initializes the purifier.

param: HTMLPurifier_Config|mixed $config Optional HTMLPurifier_Config object

addFilter($filter)   X-Ref
Adds a filter to process the output. First come first serve

param: HTMLPurifier_Filter $filter HTMLPurifier_Filter object

purify($html, $config = null)   X-Ref
Filters an HTML snippet/document to be XSS-free and standards-compliant.

param: string $html String of HTML to purify
param: HTMLPurifier_Config $config Config object for this operation,
return: string Purified HTML

purifyArray($array_of_html, $config = null)   X-Ref
Filters an array of HTML snippets

param: string[] $array_of_html Array of html snippets
param: HTMLPurifier_Config $config Optional config object for this operation.
return: string[] Array of purified HTML

instance($prototype = null)   X-Ref
Singleton for enforcing just one HTML Purifier in your system

param: HTMLPurifier|HTMLPurifier_Config $prototype Optional prototype
return: HTMLPurifier

getInstance($prototype = null)   X-Ref
Singleton for enforcing just one HTML Purifier in your system

param: HTMLPurifier|HTMLPurifier_Config $prototype Optional prototype
return: HTMLPurifier