Automatic installer.php lang files by installer_builder (20070726)
[moodle-linuxchix.git] / lib / htmlpurifier / HTMLPurifier / ChildDef / Optional.php
blobcc8883263ea1390990730eec99c04d740003179c
1 <?php
3 require_once 'HTMLPurifier/ChildDef/Required.php';
5 /**
6 * Definition that allows a set of elements, and allows no children.
7 * @note This is a hack to reuse code from HTMLPurifier_ChildDef_Required,
8 * really, one shouldn't inherit from the other. Only altered behavior
9 * is to overload a returned false with an array. Thus, it will never
10 * return false.
12 class HTMLPurifier_ChildDef_Optional extends HTMLPurifier_ChildDef_Required
14 var $allow_empty = true;
15 var $type = 'optional';
16 function validateChildren($tokens_of_children, $config, &$context) {
17 $result = parent::validateChildren($tokens_of_children, $config, $context);
18 if ($result === false) return array();
19 return $result;