mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-07-10 09:16:20 +02:00
Fix PHP 5.0 bug involving isset and DOM.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@354 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
@ -75,16 +75,15 @@ class HTMLPurifier_Lexer_DOMLex extends HTMLPurifier_Lexer
|
|||||||
protected function tokenizeDOM($node, &$tokens, $collect = false) {
|
protected function tokenizeDOM($node, &$tokens, $collect = false) {
|
||||||
// recursive goodness!
|
// recursive goodness!
|
||||||
|
|
||||||
// intercept non element nodes
|
// intercept non element nodes. WE MUST catch all of them,
|
||||||
|
// but we're not getting the character reference nodes because
|
||||||
if ( isset($node->data) ) {
|
// those should have been preprocessed
|
||||||
if ($node->nodeType === XML_TEXT_NODE ||
|
if ($node->nodeType === XML_TEXT_NODE ||
|
||||||
$node->nodeType === XML_CDATA_SECTION_NODE) {
|
$node->nodeType === XML_CDATA_SECTION_NODE) {
|
||||||
$tokens[] = $this->factory->createText($node->data);
|
$tokens[] = $this->factory->createText($node->data);
|
||||||
} elseif ($node->nodeType === XML_COMMENT_NODE) {
|
return;
|
||||||
$tokens[] = $this->factory->createComment($node->data);
|
} elseif ($node->nodeType === XML_COMMENT_NODE) {
|
||||||
}
|
$tokens[] = $this->factory->createComment($node->data);
|
||||||
// quite possibly, the object wasn't handled, that's fine
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user