3 // HTMLPurifier_ChildDef and inheritance have three types of output:
4 // true = leave nodes as is
5 // false = delete parent node and all children
6 // array(...) = replace children nodes with these
8 HTMLPurifier_ConfigSchema
::define(
9 'Core', 'EscapeInvalidChildren', false, 'bool',
10 'When true, a child is found that is not allowed in the context of the '.
11 'parent element will be transformed into text as if it were ASCII. When '.
12 'false, that element and all internal tags will be dropped, though text '.
13 'will be preserved. There is no option for dropping the element but '.
14 'preserving child nodes.'
18 * Defines allowed child nodes and validates tokens against it.
20 class HTMLPurifier_ChildDef
23 * Type of child definition, usually right-most part of class name lowercase.
24 * Used occasionally in terms of context.
30 * Bool that indicates whether or not an empty array of children is okay
32 * This is necessary for redundant checking when changes affecting
33 * a child node may cause a parent node to now be disallowed.
40 * Validates nodes according to definition and returns modification.
43 * @param $tokens_of_children Array of HTMLPurifier_Token
44 * @param $config HTMLPurifier_Config object
45 * @param $context HTMLPurifier_Context object
46 * @return bool true to leave nodes as is
47 * @return bool false to remove parent node
48 * @return array of replacement child tokens
50 function validateChildren($tokens_of_children, $config, &$context) {
51 trigger_error('Call to abstract function', E_USER_ERROR
);