1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-15 04:15:57 +00:00

Revert "add experimental HOOK_SANITIZE"

This reverts commit 2130fe7a18.
This commit is contained in:
Andrew Dolgov
2013-03-19 00:00:13 +04:00
parent 2130fe7a18
commit be124dc236
2 changed files with 5 additions and 19 deletions

View File

@@ -2597,25 +2597,12 @@
//$node = $doc->getElementsByTagName('body')->item(0);
$doc->removeChild($doc->firstChild); //remove doctype
$res = $doc->saveHTML();
$beforehooks = $res;
global $pluginhost;
if ($pluginhost) {
foreach ($pluginhost->get_hooks($pluginhost::HOOK_SANITIZE) as $p) {
$res = $p->hook_sanitize($res);
}
}
// nothing changed, use standard filters
if ($beforehooks == $res) {
$doc->removeChild($doc->firstChild); //remove doctype
$res = $doc->saveHTML();
$config = array('safe' => 1, 'deny_attribute' => 'style, width, height, class, id', 'comment' => 1, 'cdata' => 1, 'balance' => 0);
$spec = 'img=width,height';
$res = htmLawed($res, $config, $spec);
}
$config = array('safe' => 1, 'deny_attribute' => 'style, width, height, class, id', 'comment' => 1, 'cdata' => 1, 'balance' => 0);
$spec = 'img=width,height';
$res = htmLawed($res, $config, $spec);
return $res;
}