Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

(no description)

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

Defines 1 class


Class: HTMLPurifier_EntityParser  - X-Ref

Handles referencing and derefencing character entities

__construct()   X-Ref
Tests if the beginning of a string is a semi-optional regex


substituteTextEntities($string)   X-Ref
Substitute entities with the parsed equivalents.  Use this on
textual data in an HTML document (as opposed to attributes.)

return: string Parsed string.
param: string $string String to have entities parsed.

substituteAttrEntities($string)   X-Ref
Substitute entities with the parsed equivalents.  Use this on
attribute contents in documents.

return: string Parsed string.
param: string $string String to have entities parsed.

entityCallback($matches)   X-Ref
Callback function for substituteNonSpecialEntities() that does the work.

return: string Replacement string.
param: array $matches  PCRE matches array, with 0 the entire match, and

substituteNonSpecialEntities($string)   X-Ref
Substitutes non-special entities with their parsed equivalents. Since
running this whenever you have parsed character is t3h 5uck, we run
it before everything else.

return: string Parsed string.
param: string $string String to have non-special entities parsed.

nonSpecialEntityCallback($matches)   X-Ref
Callback function for substituteNonSpecialEntities() that does the work.

return: string Replacement string.
param: array $matches  PCRE matches array, with 0 the entire match, and

substituteSpecialEntities($string)   X-Ref
Substitutes only special entities with their parsed equivalents.

return: string Parsed string.
param: string $string String to have non-special entities parsed.

specialEntityCallback($matches)   X-Ref
Callback function for substituteSpecialEntities() that does the work.

This callback has same syntax as nonSpecialEntityCallback().

return: string Replacement string.
param: array $matches  PCRE-style matches array, with 0 the entire match, and