Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

(no description)

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

Defines 1 class

HTMLPurifier_Generator:: (6 methods):
  __construct()
  generateFromTokens()
  generateFromToken()
  generateScriptFromToken()
  generateAttributes()
  escape()


Class: HTMLPurifier_Generator  - X-Ref

Generates HTML from tokens.

__construct($config, $context)   X-Ref

param: HTMLPurifier_Config $config
param: HTMLPurifier_Context $context

generateFromTokens($tokens)   X-Ref
Generates HTML from an array of tokens.

param: HTMLPurifier_Token[] $tokens Array of HTMLPurifier_Token
return: string Generated HTML

generateFromToken($token)   X-Ref
Generates HTML from a single token.

param: HTMLPurifier_Token $token HTMLPurifier_Token object.
return: string Generated HTML

generateScriptFromToken($token)   X-Ref
Special case processor for the contents of script tags

param: HTMLPurifier_Token $token HTMLPurifier_Token object.
return: string

generateAttributes($assoc_array_of_attributes, $element = '')   X-Ref
Generates attribute declarations from attribute array.

param: array $assoc_array_of_attributes Attribute array
param: string $element Name of element attributes are for, used to check
return: string Generated HTML fragment for insertion.

escape($string, $quote = null)   X-Ref
Escapes raw text data.

param: string $string String data to escape for HTML.
param: int $quote Quoting style, like htmlspecialchars. ENT_NOQUOTES is
return: string escaped data.