MDL-11517 reserved word MOD used in table alias in questions backup code
[moodle-pu.git] / lib / htmlpurifier / HTMLPurifier / ChildDef.php
blob5236d266c567eec1c4163ddffcd09b20b3ccad5e
1 <?php
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.'
17 /**
18 * Defines allowed child nodes and validates tokens against it.
20 class HTMLPurifier_ChildDef
22 /**
23 * Type of child definition, usually right-most part of class name lowercase.
24 * Used occasionally in terms of context.
25 * @public
27 var $type;
29 /**
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.
35 * @public
37 var $allow_empty;
39 /**
40 * Lookup array of all elements that this definition could possibly allow
42 var $elements = array();
44 /**
45 * Validates nodes according to definition and returns modification.
47 * @public
48 * @param $tokens_of_children Array of HTMLPurifier_Token
49 * @param $config HTMLPurifier_Config object
50 * @param $context HTMLPurifier_Context object
51 * @return bool true to leave nodes as is
52 * @return bool false to remove parent node
53 * @return array of replacement child tokens
55 function validateChildren($tokens_of_children, $config, &$context) {
56 trigger_error('Call to abstract function', E_USER_ERROR);