diff options
author | Mario Vavti <mario@mariovavti.com> | 2019-09-23 09:11:05 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2019-09-23 12:20:28 +0200 |
commit | e37c43ea06deabe86bd0ec572a89e5159b4b6997 (patch) | |
tree | 730d849035b445042de07674aaae8745d2daa71f /vendor/ezyang/htmlpurifier/library/HTMLPurifier/Lexer | |
parent | 9b90114d035ce4c10ee11cd2fbffe1f5ab95af17 (diff) | |
download | volse-hubzilla-e37c43ea06deabe86bd0ec572a89e5159b4b6997.tar.gz volse-hubzilla-e37c43ea06deabe86bd0ec572a89e5159b4b6997.tar.bz2 volse-hubzilla-e37c43ea06deabe86bd0ec572a89e5159b4b6997.zip |
composer update ezyang/htmlpurifier
(cherry picked from commit a34ce790129bdd729a5019895ea6cd4c59f08ba4)
Diffstat (limited to 'vendor/ezyang/htmlpurifier/library/HTMLPurifier/Lexer')
-rw-r--r-- | vendor/ezyang/htmlpurifier/library/HTMLPurifier/Lexer/DOMLex.php | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Lexer/DOMLex.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Lexer/DOMLex.php index 6238a99e3..b573426de 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Lexer/DOMLex.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Lexer/DOMLex.php @@ -68,8 +68,13 @@ class HTMLPurifier_Lexer_DOMLex extends HTMLPurifier_Lexer $doc = new DOMDocument(); $doc->encoding = 'UTF-8'; // theoretically, the above has this covered + $options = 0; + if ($config->get('Core.AllowParseManyTags') && defined('LIBXML_PARSEHUGE')) { + $options |= LIBXML_PARSEHUGE; + } + set_error_handler(array($this, 'muteErrorHandler')); - $doc->loadHTML($html); + $doc->loadHTML($html, $options); restore_error_handler(); $body = $doc->getElementsByTagName('html')->item(0)-> // <html> @@ -133,11 +138,11 @@ class HTMLPurifier_Lexer_DOMLex extends HTMLPurifier_Lexer */ protected function getTagName($node) { - if (property_exists($node, 'tagName')) { + if (isset($node->tagName)) { return $node->tagName; - } else if (property_exists($node, 'nodeName')) { + } else if (isset($node->nodeName)) { return $node->nodeName; - } else if (property_exists($node, 'localName')) { + } else if (isset($node->localName)) { return $node->localName; } return null; @@ -150,11 +155,11 @@ class HTMLPurifier_Lexer_DOMLex extends HTMLPurifier_Lexer */ protected function getData($node) { - if (property_exists($node, 'data')) { + if (isset($node->data)) { return $node->data; - } else if (property_exists($node, 'nodeValue')) { + } else if (isset($node->nodeValue)) { return $node->nodeValue; - } else if (property_exists($node, 'textContent')) { + } else if (isset($node->textContent)) { return $node->textContent; } return null; |