1 : <?php
2 :
3 : /**
4 : * Defines allowed child nodes and validates tokens against it.
5 : */
6 : abstract class HTMLPurifier_ChildDef
7 1 : {
8 : /**
9 : * Type of child definition, usually right-most part of class name lowercase.
10 : * Used occasionally in terms of context.
11 : */
12 : public $type;
13 :
14 : /**
15 : * Bool that indicates whether or not an empty array of children is okay
16 : *
17 : * This is necessary for redundant checking when changes affecting
18 : * a child node may cause a parent node to now be disallowed.
19 : */
20 : public $allow_empty;
21 :
22 : /**
23 : * Lookup array of all elements that this definition could possibly allow
24 : */
25 : public $elements = array();
26 :
27 : /**
28 : * Validates nodes according to definition and returns modification.
29 : *
30 : * @param $tokens_of_children Array of HTMLPurifier_Token
31 : * @param $config HTMLPurifier_Config object
32 : * @param $context HTMLPurifier_Context object
33 : * @return bool true to leave nodes as is
34 : * @return bool false to remove parent node
35 : * @return array of replacement child tokens
36 : */
37 : abstract public function validateChildren($tokens_of_children, $config, $context);
38 : }
39 :
40 :
|