summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2013-04-26 00:02:13 +0400
committerAndrew Dolgov <[email protected]>2013-04-26 00:02:13 +0400
commitdcd7ecaa0fb196eb8cd0af431a866dbac81b460c (patch)
tree7cf7895598a928a0b2d2950e2d8b1510957e9451 /include
parent90e5f4f1de6219029466c32777e47dd2ffb61cdc (diff)
strip_harmful_tags: use XPath to actually get all tags to work on
Diffstat (limited to 'include')
-rw-r--r--include/functions.php3
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)) {