init.php 516 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. class No_Iframes extends Plugin {
  3. private $host;
  4. function about() {
  5. return array(1.0,
  6. "Remove embedded iframes",
  7. "fox");
  8. }
  9. function init($host) {
  10. $this->host = $host;
  11. $host->add_hook($host::HOOK_SANITIZE, $this);
  12. }
  13. function hook_sanitize($doc, $site_url, $allowed_elements, $disallowed_attributes) {
  14. $allowed_elements = array_diff($allowed_elements, array("iframe"));
  15. return array($doc, $allowed_elements, $disallowed_attributes);
  16. }
  17. function api_version() {
  18. return 2;
  19. }
  20. }
  21. ?>