]> git.wh0rd.org Git - tt-rss.git/commitdiff
Revert "add experimental HOOK_SANITIZE"
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Mon, 18 Mar 2013 20:00:13 +0000 (00:00 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Mon, 18 Mar 2013 20:00:13 +0000 (00:00 +0400)
This reverts commit 2130fe7a18d7e1863575feda9ec39654541eee77.

classes/pluginhost.php
include/functions.php

index 79544b01b6a7f3378d92e309c6c2cd342dc82f7c..592629881e98dbbccab8bd306ca5c205c4f66baf 100644 (file)
@@ -21,7 +21,6 @@ class PluginHost {
        const HOOK_RENDER_ARTICLE = 10;
        const HOOK_RENDER_ARTICLE_CDM = 11;
        const HOOK_FEED_FETCHED = 12;
-       const HOOK_SANITIZE = 13;
 
        const KIND_ALL = 1;
        const KIND_SYSTEM = 2;
index ae95613370e2e98529428ceb0695f8ea51fe6309..2120a96b92bba3c6142ff0dcd6fd0cfa4c4d7a1a 100644 (file)
 
                //$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;
        }