mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-16 06:45:56 +00:00
Revert "sanitize: remove doctype properly, add experimental workaround against unnecessary html elements in sanitized data"
This reverts commit f44d59992e.
This commit is contained in:
@@ -2892,7 +2892,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$doc->removeChild($doc->doctype); //remove doctype
|
$doc->removeChild($doc->firstChild); //remove doctype
|
||||||
$doc = strip_harmful_tags($doc, $allowed_elements, $disallowed_attributes);
|
$doc = strip_harmful_tags($doc, $allowed_elements, $disallowed_attributes);
|
||||||
|
|
||||||
if ($highlight_words) {
|
if ($highlight_words) {
|
||||||
@@ -2925,19 +2925,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$body = $doc->getElementsByTagName("body")->item(0);
|
|
||||||
|
|
||||||
if ($body) {
|
|
||||||
$div = $doc->createElement("div");
|
|
||||||
|
|
||||||
foreach ($body->childNodes as $child) {
|
|
||||||
$div->appendChild($child);
|
|
||||||
}
|
|
||||||
|
|
||||||
$res = $doc->saveXML($div);
|
|
||||||
} else {
|
|
||||||
$res = $doc->saveHTML();
|
$res = $doc->saveHTML();
|
||||||
}
|
|
||||||
|
|
||||||
return $res;
|
return $res;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user