]>
git.wh0rd.org - tt-rss.git/blob - plugins/no_iframes/init.php
2 class No_Iframes
extends Plugin
{
7 "Remove embedded iframes (unless whitelisted)",
11 function init($host) {
14 $host->add_hook($host::HOOK_SANITIZE
, $this);
17 function hook_sanitize($doc, $site_url, $allowed_elements, $disallowed_attributes) {
19 $xpath = new DOMXpath($doc);
20 $entries = $xpath->query('//iframe');
22 foreach ($entries as $entry) {
23 if (!iframe_whitelisted($entry))
24 $entry->parentNode
->removeChild($entry);
27 return array($doc, $allowed_elements, $disallowed_attributes);
30 function api_version() {