Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 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.

(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.)

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

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

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

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

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

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.

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

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

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

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

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

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

This callback has same syntax as nonSpecialEntityCallback().

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