\HTMLPurifier_ChildDef_Custom

Custom validation class, accepts DTD child definitions

Summary

Methods
Properties
Constants
getAllowedElements()
validateChildren()
__construct()
$type
$allow_empty
$elements
$dtd_regex
No constants found
_compileRegex()
No protected properties found
N/A
No private methods found
$_pcre_regex
N/A

Properties

$type

$type

Type of child definition, usually right-most part of class name lowercase.

$allow_empty

$allow_empty

Indicates whether or not an empty array of children is okay.

$elements

$elements

Lookup array of all elements that this definition could possibly allow.

$dtd_regex

$dtd_regex

Allowed child pattern as defined by the DTD.

$_pcre_regex

$_pcre_regex

PCRE regex derived from $dtd_regex.

Methods

getAllowedElements()

getAllowedElements(\HTMLPurifier_Config  $config) : array

Get lookup of tag names that should not close this element automatically.

All other elements will do so.

Parameters

\HTMLPurifier_Config $config

HTMLPurifier_Config object

Returns

array —

validateChildren()

validateChildren(\HTMLPurifier_Node[]  $children, \HTMLPurifier_Config  $config, \HTMLPurifier_Context  $context) : bool

Validates nodes according to definition and returns modification.

Parameters

\HTMLPurifier_Node[] $children
\HTMLPurifier_Config $config
\HTMLPurifier_Context $context

Returns

bool —

__construct()

__construct( $dtd_regex) : mixed

Parameters

$dtd_regex

Allowed child pattern from the DTD

Returns

mixed —

_compileRegex()

_compileRegex() : mixed

Compiles the PCRE regex from a DTD regex ($dtd_regex to $_pcre_regex)

Returns

mixed —