HTMLPurifier 4.4.0
HTMLPurifier_ChildDef_Custom Class Reference

Custom validation class, accepts DTD child definitions. More...

Inheritance diagram for HTMLPurifier_ChildDef_Custom:
HTMLPurifier_ChildDef HTMLPurifier_ChildDef

List of all members.

Public Member Functions

 __construct ($dtd_regex)
 validateChildren ($tokens_of_children, $config, $context)
 Validates nodes according to definition and returns modification.
 __construct ($dtd_regex)
 validateChildren ($tokens_of_children, $config, $context)
 Validates nodes according to definition and returns modification.

Public Attributes

 $type = 'custom'
 Type of child definition, usually right-most part of class name lowercase.
 $allow_empty = false
 Bool that indicates whether or not an empty array of children is okay.
 $dtd_regex
 Allowed child pattern as defined by the DTD.

Protected Member Functions

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

Private Attributes

 $_pcre_regex
 PCRE regex derived from $dtd_regex.

Detailed Description

Custom validation class, accepts DTD child definitions.

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

Definition at line 9 of file Custom.php.


Constructor & Destructor Documentation

HTMLPurifier_ChildDef_Custom::__construct ( dtd_regex)
Parameters:
$dtd_regexAllowed child pattern from the DTD

Definition at line 25 of file Custom.php.

References $dtd_regex, and _compileRegex().

HTMLPurifier_ChildDef_Custom::__construct ( dtd_regex)
Parameters:
$dtd_regexAllowed child pattern from the DTD

Definition at line 11376 of file HTMLPurifier.standalone.php.

References $dtd_regex, and _compileRegex().


Member Function Documentation

HTMLPurifier_ChildDef_Custom::_compileRegex ( ) [protected]

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

Definition at line 32 of file Custom.php.

Referenced by __construct().

HTMLPurifier_ChildDef_Custom::_compileRegex ( ) [protected]

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

Definition at line 11383 of file HTMLPurifier.standalone.php.

HTMLPurifier_ChildDef_Custom::validateChildren ( tokens_of_children,
config,
context 
)

Validates nodes according to definition and returns modification.

Parameters:
$tokens_of_childrenArray of HTMLPurifier_Token
$configHTMLPurifier_Config object
$contextHTMLPurifier_Context object
Returns:
bool true to leave nodes as is
bool false to remove parent node
array of replacement child tokens

Reimplemented from HTMLPurifier_ChildDef.

Definition at line 11411 of file HTMLPurifier.standalone.php.

HTMLPurifier_ChildDef_Custom::validateChildren ( tokens_of_children,
config,
context 
)

Validates nodes according to definition and returns modification.

Parameters:
$tokens_of_childrenArray of HTMLPurifier_Token
$configHTMLPurifier_Config object
$contextHTMLPurifier_Context object
Returns:
bool true to leave nodes as is
bool false to remove parent node
array of replacement child tokens

Reimplemented from HTMLPurifier_ChildDef.

Definition at line 60 of file Custom.php.


Member Data Documentation

HTMLPurifier_ChildDef_Custom::$_pcre_regex [private]

PCRE regex derived from $dtd_regex.

Definition at line 21 of file Custom.php.

HTMLPurifier_ChildDef_Custom::$allow_empty = false

Bool that 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.

Reimplemented from HTMLPurifier_ChildDef.

Definition at line 12 of file Custom.php.

HTMLPurifier_ChildDef_Custom::$dtd_regex

Allowed child pattern as defined by the DTD.

Definition at line 16 of file Custom.php.

Referenced by __construct().

HTMLPurifier_ChildDef_Custom::$type = 'custom'

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

Used occasionally in terms of context.

Reimplemented from HTMLPurifier_ChildDef.

Definition at line 11 of file Custom.php.


The documentation for this class was generated from the following files: