]> git.wh0rd.org - tt-rss.git/commitdiff
add no_iframes plugin
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Thu, 1 Aug 2013 08:52:51 +0000 (12:52 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Thu, 1 Aug 2013 08:52:51 +0000 (12:52 +0400)
plugins/no_iframes/init.php [new file with mode: 0644]

diff --git a/plugins/no_iframes/init.php b/plugins/no_iframes/init.php
new file mode 100644 (file)
index 0000000..c66d7ab
--- /dev/null
@@ -0,0 +1,29 @@
+<?php
+class No_Iframes extends Plugin {
+       private $host;
+
+       function about() {
+               return array(1.0,
+                       "Remove embedded iframes",
+                       "fox");
+       }
+
+       function init($host) {
+               $this->host = $host;
+
+               $host->add_hook($host::HOOK_SANITIZE, $this);
+       }
+
+       function hook_sanitize($doc, $site_url, $allowed_elements, $disallowed_attributes) {
+
+               $allowed_elements = array_diff($allowed_elements, array("iframe"));
+
+               return array($doc, $allowed_elements, $disallowed_attributes);
+       }
+
+       function api_version() {
+               return 2;
+       }
+
+}
+?>