From: Andrew Dolgov Date: Thu, 25 Apr 2013 20:02:13 +0000 (+0400) Subject: strip_harmful_tags: use XPath to actually get all tags to work on X-Git-Tag: 1.7.9~25^2~80 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=dcd7ecaa0fb196eb8cd0af431a866dbac81b460c;p=tt-rss.git strip_harmful_tags: use XPath to actually get all tags to work on --- 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)) {