]> git.wh0rd.org Git - tt-rss.git/commitdiff
strip_harmful_tags: use XPath to actually get all tags to work on
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Thu, 25 Apr 2013 20:02:13 +0000 (00:02 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Thu, 25 Apr 2013 20:02:13 +0000 (00:02 +0400)
include/functions.php

index 8d09abf7b663f300ee1dc087c8fa824c20a10974..8ecdb71e5ae2e2f43b6173a06efece617efbb566 100644 (file)
        }
 
        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)) {