Abstract Class HTMLPurifier_ChildDef

InheritanceHTMLPurifier_ChildDef
SubclassesHTMLPurifier_ChildDef_Chameleon, HTMLPurifier_ChildDef_Custom, HTMLPurifier_ChildDef_Empty, HTMLPurifier_ChildDef_List, HTMLPurifier_ChildDef_Optional, HTMLPurifier_ChildDef_Required, HTMLPurifier_ChildDef_StrictBlockquote, HTMLPurifier_ChildDef_Table

Defines allowed child nodes and validates nodes against it.

Public Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$allow_empty Indicates whether or not an empty array of children is okay. HTMLPurifier_ChildDef
$elements Lookup array of all elements that this definition could possibly allow. HTMLPurifier_ChildDef
$type Type of child definition, usually right-most part of class name lowercase. HTMLPurifier_ChildDef

Public Methods

Hide inherited methods

MethodDescriptionDefined By
getAllowedElements() Get lookup of tag names that should not close this element automatically. HTMLPurifier_ChildDef
validateChildren() Validates nodes according to definition and returns modification. HTMLPurifier_ChildDef

Property Details

$allow_empty public property

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

public $allow_empty null
$elements public property
public $elements = []
$type public property

Used occasionally in terms of context.

public $type null

Method Details

getAllowedElements() public method

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

All other elements will do so.

public array getAllowedElements ( $config )
$config HTMLPurifier_Config

HTMLPurifier_Config object

validateChildren() public abstract method

Validates nodes according to definition and returns modification.

public abstract bool|array validateChildren ( $children, $config, $context )
$children HTMLPurifier_Node[]

Array of HTMLPurifier_Node

$config HTMLPurifier_Config

HTMLPurifier_Config object

$context HTMLPurifier_Context

HTMLPurifier_Context object

return bool|array

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