123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- <?php
- class HTMLPurifier_ChildDef_Optional extends HTMLPurifier_ChildDef_Required
- {
-
- public $allow_empty = true;
-
- public $type = 'optional';
-
- public function validateChildren($children, $config, $context)
- {
- $result = parent::validateChildren($children, $config, $context);
-
- if ($result === false) {
- if (empty($children)) {
- return true;
- } elseif ($this->whitespace) {
- return $children;
- } else {
- return array();
- }
- }
- return $result;
- }
- }
|