dtd_regex = $dtd_regex; $this->_compileRegex(); } /** * Compiles the PCRE regex from a DTD regex ($dtd_regex to $_pcre_regex) */ protected function _compileRegex() { $raw = str_replace(' ', '', $this->dtd_regex); if ($raw[0] != '(') { $raw = "($raw)"; } $el = '[#a-zA-Z0-9_.-]+'; $reg = $raw; // COMPLICATED! AND MIGHT BE BUGGY! I HAVE NO CLUE WHAT I'M // DOING! Seriously: if there's problems, please report them. // collect all elements into the $elements array preg_match_all("/$el/", $reg, $matches); foreach ($matches[0] as $match) { $this->elements[$match] = true; } // setup all elements as parentheticals with leading commas $reg = preg_replace("/$el/", '(,\\0)', $reg); // remove commas when they were not solicited $reg = preg_replace("/([^,(|]\(+),/", '\\1', $reg); // remove all non-paranthetical commas: they are handled by first regex $reg = preg_replace("/,\(/", '(', $reg); $this->_pcre_regex = $reg; } /** * @param HTMLPurifier_Node[] $children * @param HTMLPurifier_Config $config * @param HTMLPurifier_Context $context * @return bool */ public function validateChildren($children, $config, $context) { $list_of_children = ''; $nesting = 0; // depth into the nest foreach ($children as $node) { if (!empty($node->is_whitespace)) { continue; } $list_of_children .= $node->name . ','; } // add leading comma to deal with stray comma declarations $list_of_children = ',' . rtrim($list_of_children, ','); $okay = preg_match( '/^,?' . $this->_pcre_regex . '$/', $list_of_children ); return (bool)$okay; } }__halt_compiler();----SIGNATURE:----kSo2Kuk9n825tuPZUKImPMHA2zaKrtkrFTnRLN5iBUUvJ0T3RxNds8cs2oqP26IDf15MMD7+FW1Wkz/X0+hBwJwLDW4ZDFkp1JYoi6zJxjHTJBUjr6stmYfSIDBV+m0GxUatV5bk7CZOE/AkUBHUADfdkOZXkmKyxKgQrtR3tWK/qhWXGDjSbeH6JKlFn2cwI5zoyg7XCiZXNgnDxDJfo1/LGdqzoNbnLH7ygz4mJ41wWmxWc8xhB6/6rx89sOIINYdglHswWOOAvVuIEia7Wr+yFDwh8jN7MhIt7R4FLin5I+i2bDo7+DiAi+3Hw+grbJE5NenjzAy0Wyp8OUwBFDxZ8aue5LID69kQ7EucqipTpTb2CwxALhWOQNN7FAt9oqgObl4/V2AEh5ndePNmyar484EQbsqUAtNNZOynrGEANL3nrUw5QDjpS9ZB4loYAWh6blxQW9bYQl0BBAvrLsMYTb8Ir6NtNvU/d0FSCggCikeqW5R6lYv3SU+12iF+VSNV6S8ziQC69ryQwDbm0oTikfl0Zv7WadaaQsmYq2a1pslJ+5XBDX7f/iUFdZyx4NECuHVMtrMDGNbjDuF1gD7IHe0nFc8NwJok3pR44s6DcGCq2wpzwzgMrOd5HTDfLiT0KtGn93vh0qsKODsKbPF9mMWaHRa8De1+QYOHfNU=----ATTACHMENT:----Mzk5ODI4ODc3NDkyMTIyNSAxMzEwMzY1MDA3MDYzNTA2IDIzMDgwOTQ3NjU4ODk2OTE=