00001 <?php 00002 00010 class HTMLPurifier_ChildDef_Optional extends HTMLPurifier_ChildDef_Required 00011 { 00012 public $allow_empty = true; 00013 public $type = 'optional'; 00014 public function validateChildren($tokens_of_children, $config, $context) { 00015 $result = parent::validateChildren($tokens_of_children, $config, $context); 00016 if ($result === false) { 00017 if (empty($tokens_of_children)) return true; 00018 else return array(); 00019 } 00020 return $result; 00021 } 00022 } 00023
1.5.3