summaryrefslogtreecommitdiff
path: root/plugins/no_iframes
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2013-08-01 12:52:51 +0400
committerAndrew Dolgov <[email protected]>2013-08-01 12:52:51 +0400
commit615a6cac60b145a26b5b0c1fd41993c502030756 (patch)
treeea8df9b1884ca98d532644bd210059dbcb0fd821 /plugins/no_iframes
parent22e2ea41662d4880e1fdad8d4056b954cd3067bd (diff)
add no_iframes plugin
Diffstat (limited to 'plugins/no_iframes')
-rw-r--r--plugins/no_iframes/init.php29
1 files changed, 29 insertions, 0 deletions
diff --git a/plugins/no_iframes/init.php b/plugins/no_iframes/init.php
new file mode 100644
index 000000000..c66d7abaf
--- /dev/null
+++ b/plugins/no_iframes/init.php
@@ -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;
+ }
+
+}
+?>