HTMLPurifier_ChildDef_Custom
extends HTMLPurifier_ChildDef
in package
Custom validation class, accepts DTD child definitions
Tags
Table of Contents
Properties
- $allow_empty : mixed
- Indicates whether or not an empty array of children is okay.
- $dtd_regex : mixed
- Allowed child pattern as defined by the DTD.
- $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.
- $_pcre_regex : mixed
- PCRE regex derived from $dtd_regex.
Methods
- __construct() : mixed
- getAllowedElements() : array<string|int, mixed>
- Get lookup of tag names that should not close this element automatically.
- validateChildren() : bool
- Validates nodes according to definition and returns modification.
- _compileRegex() : mixed
- Compiles the PCRE regex from a DTD regex ($dtd_regex to $_pcre_regex)
Properties
$allow_empty
Indicates whether or not an empty array of children is okay.
public
mixed
$allow_empty
= \false
Tags
$dtd_regex
Allowed child pattern as defined by the DTD.
public
mixed
$dtd_regex
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
= 'custom'
Tags
$_pcre_regex
PCRE regex derived from $dtd_regex.
private
mixed
$_pcre_regex
Tags
Methods
__construct()
public
__construct(mixed $dtd_regex) : mixed
Parameters
- $dtd_regex : mixed
-
Allowed child pattern from the DTD
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
validateChildren(array<string|int, HTMLPurifier_Node> $children, HTMLPurifier_Config $config, HTMLPurifier_Context $context) : bool
Parameters
- $children : array<string|int, HTMLPurifier_Node>
- $config : HTMLPurifier_Config
- $context : HTMLPurifier_Context
Return values
bool_compileRegex()
Compiles the PCRE regex from a DTD regex ($dtd_regex to $_pcre_regex)
protected
_compileRegex() : mixed