Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

(no description)

File Size: 286 lines (10 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.