\HTMLPurifier_ChildDef

Defines allowed child nodes and validates nodes against it.

Summary

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

Properties

$type

$type

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

Used occasionally in terms of context.

$allow_empty

$allow_empty

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

This is necessary for redundant checking when changes affecting a child node may cause a parent node to now be disallowed.

$elements

$elements

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

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|array

Validates nodes according to definition and returns modification.

Parameters

\HTMLPurifier_Node[] $children

Array of HTMLPurifier_Node

\HTMLPurifier_Config $config

HTMLPurifier_Config object

\HTMLPurifier_Context $context

HTMLPurifier_Context object

Returns

bool|array —

true to leave nodes as is, false to remove parent node, array of replacement children