HumHub Documentation (unofficial)

HTMLPurifier_ChildDef_Custom extends HTMLPurifier_ChildDef
in package

Custom validation class, accepts DTD child definitions

Tags
warning

Currently this class is an all or nothing proposition, that is, it will only give a bool return value.

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
type

bool

$dtd_regex

Allowed child pattern as defined by the DTD.

public mixed $dtd_regex
Tags
type

string

$elements

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

public mixed $elements = array()
Tags
type

array

$type

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

public mixed $type = 'custom'
Tags
type

string

$_pcre_regex

PCRE regex derived from $dtd_regex.

private mixed $_pcre_regex
Tags
type

string

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>

_compileRegex()

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

protected _compileRegex() : mixed

        
On this page

Search results