1: <?php
2:
3: 4: 5: 6: 7: 8: 9:
10: class HTMLPurifier_ChildDef_Optional extends HTMLPurifier_ChildDef_Required
11: {
12: public $allow_empty = true;
13: public $type = 'optional';
14: public function validateChildren($tokens_of_children, $config, $context) {
15: $result = parent::validateChildren($tokens_of_children, $config, $context);
16:
17: if ($result === false) {
18: if (empty($tokens_of_children)) return true;
19: elseif ($this->whitespace) return $tokens_of_children;
20: else return array();
21: }
22: return $result;
23: }
24: }
25:
26:
27: