Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.2.x will end 22 April 2024 (12 months).
  • Bug fixes for security issues in 4.2.x will end 7 October 2024 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.1.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.