Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

(no description)

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

Defines 1 class

HTMLPurifier_Lexer_DirectLex:: (4 methods):
  scriptCallback()
  tokenizeHTML()
  substrCount()
  parseAttributeString()


Class: HTMLPurifier_Lexer_DirectLex  - X-Ref

Our in-house implementation of a parser.

A pure PHP parser, DirectLex has absolutely no dependencies, making
it a reasonably good default for PHP4.  Written with efficiency in mind,
it can be four times faster than HTMLPurifier_Lexer_PEARSax3, although it
pales in comparison to HTMLPurifier_Lexer_DOMLex.

scriptCallback($matches)   X-Ref
Callback function for script CDATA fudge

param: array $matches, in form of array(opening tag, contents, closing tag)
return: string

tokenizeHTML($html, $config, $context)   X-Ref

param: String $html
param: HTMLPurifier_Config $config
param: HTMLPurifier_Context $context
return: array|HTMLPurifier_Token[]

substrCount($haystack, $needle, $offset, $length)   X-Ref
PHP 5.0.x compatible substr_count that implements offset and length

param: string $haystack
param: string $needle
param: int $offset
param: int $length
return: int

parseAttributeString($string, $config, $context)   X-Ref
Takes the inside of an HTML tag and makes an assoc array of attributes.

param: string $string Inside of tag excluding name.
param: HTMLPurifier_Config $config
param: HTMLPurifier_Context $context
return: array Assoc array of attributes.