Total Complexity | 6 |
Total Lines | 34 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
2 | class No_Iframes extends Plugin { |
||
3 | private $host; |
||
4 | |||
5 | public function about() { |
||
9 | } |
||
10 | |||
11 | public function init($host) { |
||
15 | } |
||
16 | |||
17 | /** |
||
18 | * @SuppressWarnings(PHPMD.UnusedFormalParameter) |
||
19 | */ |
||
20 | public function hook_sanitize($doc, $site_url, $allowed_elements, $disallowed_attributes) { |
||
|
|||
21 | |||
22 | $xpath = new DOMXpath($doc); |
||
23 | $entries = $xpath->query('//iframe'); |
||
24 | |||
25 | foreach ($entries as $entry) { |
||
26 | if (!iframe_whitelisted($entry)) { |
||
27 | $entry->parentNode->removeChild($entry); |
||
28 | } |
||
29 | } |
||
30 | |||
31 | return array($doc, $allowed_elements, $disallowed_attributes); |
||
32 | } |
||
33 | |||
34 | public function api_version() { |
||
36 | } |
||
37 | |||
39 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.