inline = new HTMLPurifier_ChildDef_Optional($inline); $this->block = new HTMLPurifier_ChildDef_Optional($block); } function validateChildren($tokens_of_children, $config, &$context) { $parent_type = $context->get('ParentType'); switch ($parent_type) { case 'unknown': case 'inline': $result = $this->inline->validateChildren( $tokens_of_children, $config, $context); break; case 'block': $result = $this->block->validateChildren( $tokens_of_children, $config, $context); break; default: trigger_error('Invalid context', E_USER_ERROR); return false; } return $result; } } ?>