strip_harmful_tags: use XPath to actually get all tags to work on
This commit is contained in:
parent
90e5f4f1de
commit
dcd7ecaa0f
1 changed files with 2 additions and 1 deletions
|
@ -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)) {
|
||||
|
|
Loading…
Reference in a new issue