]>
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);
18 * @SuppressWarnings(PHPMD.UnusedFormalParameter)
20 function hook_sanitize($doc, $site_url, $allowed_elements, $disallowed_attributes) {
22 $xpath = new DOMXpath($doc);
23 $entries = $xpath->query('//iframe');
25 foreach ($entries as $entry) {
26 if (!iframe_whitelisted($entry))
27 $entry->parentNode
->removeChild($entry);
30 return array($doc, $allowed_elements, $disallowed_attributes);
33 function api_version() {