HTMLPurifier_ChildDef
in package
Defines allowed child nodes and validates nodes against it.
Table of Contents
Properties
- $allow_empty : mixed
- Indicates whether or not an empty array of children is okay.
- $elements : mixed
- Lookup array of all elements that this definition could possibly allow.
- $type : mixed
- Type of child definition, usually right-most part of class name lowercase.
Methods
- getAllowedElements() : array<string|int, mixed>
- Get lookup of tag names that should not close this element automatically.
- validateChildren() : bool|array<string|int, mixed>
- Validates nodes according to definition and returns modification.
Properties
$allow_empty
Indicates whether or not an empty array of children is okay.
public
mixed
$allow_empty
This is necessary for redundant checking when changes affecting a child node may cause a parent node to now be disallowed.
Tags
$elements
Lookup array of all elements that this definition could possibly allow.
public
mixed
$elements
= array()
Tags
$type
Type of child definition, usually right-most part of class name lowercase.
public
mixed
$type
Used occasionally in terms of context.
Tags
Methods
getAllowedElements()
Get lookup of tag names that should not close this element automatically.
public
getAllowedElements(HTMLPurifier_Config $config) : array<string|int, mixed>
All other elements will do so.
Parameters
- $config : HTMLPurifier_Config
-
HTMLPurifier_Config object
Return values
array<string|int, mixed>validateChildren()
Validates nodes according to definition and returns modification.
public
abstract validateChildren(array<string|int, HTMLPurifier_Node> $children, HTMLPurifier_Config $config, HTMLPurifier_Context $context) : bool|array<string|int, mixed>
Parameters
- $children : array<string|int, HTMLPurifier_Node>
-
Array of HTMLPurifier_Node
- $config : HTMLPurifier_Config
-
HTMLPurifier_Config object
- $context : HTMLPurifier_Context
-
HTMLPurifier_Context object
Return values
bool|array<string|int, mixed> —true to leave nodes as is, false to remove parent node, array of replacement children