26 if ($keys == array_keys($keys)) {
39 $this->whitespace =
false;
42 if (empty($tokens_of_children))
return false;
56 $pcdata_allowed = isset($this->elements[
'#PCDATA']);
59 $all_whitespace =
true;
62 $escape_invalid_children = $config->get(
'Core.EscapeInvalidChildren');
67 foreach ($tokens_of_children as $token) {
68 if (!empty($token->is_whitespace)) {
72 $all_whitespace =
false;
74 $is_child = ($nesting == 0);
84 if (!isset($this->elements[$token->name])) {
88 } elseif ($pcdata_allowed && $escape_invalid_children) {
89 $result[] =
new HTMLPurifier_Token_Text(
90 $gen->generateFromToken($token)
98 } elseif ($pcdata_allowed && $escape_invalid_children) {
100 new HTMLPurifier_Token_Text(
101 $gen->generateFromToken($token)
107 if (empty(
$result))
return false;
108 if ($all_whitespace) {
109 $this->whitespace =
true;
112 if ($tokens_of_children ==
$result)
return true;