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: 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.