diff options
| author | Andrew Dolgov <fox@madoka.volgo-balt.ru> | 2013-08-01 12:52:51 +0400 |
|---|---|---|
| committer | Andrew Dolgov <fox@madoka.volgo-balt.ru> | 2013-08-01 12:52:51 +0400 |
| commit | 615a6cac60b145a26b5b0c1fd41993c502030756 (patch) | |
| tree | ea8df9b1884ca98d532644bd210059dbcb0fd821 /plugins | |
| parent | 22e2ea41662d4880e1fdad8d4056b954cd3067bd (diff) | |
add no_iframes plugin
Diffstat (limited to 'plugins')
| -rw-r--r-- | plugins/no_iframes/init.php | 29 |
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; + } + +} +?> |