1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 22:05:56 +00:00

strip_harmful_tags: use XPath to actually get all tags to work on

This commit is contained in:
Andrew Dolgov
2013-04-26 00:02:13 +04:00
parent 90e5f4f1de
commit dcd7ecaa0f

View File

@@ -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)) {