add no_iframes plugin

This commit is contained in:
Andrew Dolgov 2013-08-01 12:52:51 +04:00
parent 22e2ea4166
commit 615a6cac60
1 changed files with 29 additions and 0 deletions

View File

@ -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;
}
}
?>