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