From dcd7ecaa0fb196eb8cd0af431a866dbac81b460c Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 26 Apr 2013 00:02:13 +0400 Subject: [PATCH] strip_harmful_tags: use XPath to actually get all tags to work on --- include/functions.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/functions.php b/include/functions.php index 8d09abf7..8ecdb71e 100644 --- a/include/functions.php +++ b/include/functions.php @@ -2801,7 +2801,8 @@ } function strip_harmful_tags($doc, $allowed_elements, $disallowed_attributes) { - $entries = $doc->getElementsByTagName("*"); + $xpath = new DOMXPath($doc); + $entries = $xpath->query('//*'); foreach ($entries as $entry) { if (!in_array($entry->nodeName, $allowed_elements)) { -- 2.39.5