From 3cb77da11d4eb3420a7f720ece66df91588fe433 Mon Sep 17 00:00:00 2001 From: Mateusz Turcza Date: Sun, 4 Mar 2018 19:22:03 +0100 Subject: [PATCH] Make tagName and node data detection hhvm compatible (#170) --- library/HTMLPurifier/Lexer/DOMLex.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/library/HTMLPurifier/Lexer/DOMLex.php b/library/HTMLPurifier/Lexer/DOMLex.php index 6238a99e..ebbcbb16 100644 --- a/library/HTMLPurifier/Lexer/DOMLex.php +++ b/library/HTMLPurifier/Lexer/DOMLex.php @@ -133,11 +133,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 +150,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;