diff options
author | Andrew Dolgov <[email protected]> | 2013-04-26 00:02:13 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2013-04-26 00:02:13 +0400 |
commit | dcd7ecaa0fb196eb8cd0af431a866dbac81b460c (patch) | |
tree | 7cf7895598a928a0b2d2950e2d8b1510957e9451 /include/functions.php | |
parent | 90e5f4f1de6219029466c32777e47dd2ffb61cdc (diff) |
strip_harmful_tags: use XPath to actually get all tags to work on
Diffstat (limited to 'include/functions.php')
-rw-r--r-- | include/functions.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/functions.php b/include/functions.php index 8d09abf7b..8ecdb71e5 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)) { |