diff options
author | Andrew Dolgov <[email protected]> | 2019-11-27 22:46:43 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2019-11-27 22:46:43 +0300 |
commit | 219840341c54e3db02dfaf62a88e40fea9badfb5 (patch) | |
tree | c013f418ec56e8e730c69607a16b3db91dfbfd2c /plugins/af_youtube_embed/init.php | |
parent | d15f0349bf1671d3b3704f728372b7fb3f4045bd (diff) |
Af_Youtube_Embed: whitelist youtube iframes if enabled
Diffstat (limited to 'plugins/af_youtube_embed/init.php')
-rw-r--r-- | plugins/af_youtube_embed/init.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/plugins/af_youtube_embed/init.php b/plugins/af_youtube_embed/init.php index 16dcc926c..0a6160752 100644 --- a/plugins/af_youtube_embed/init.php +++ b/plugins/af_youtube_embed/init.php @@ -4,7 +4,7 @@ class Af_Youtube_Embed extends Plugin { function about() { return array(1.0, - "Embed videos in Youtube RSS feeds", + "Embed videos in Youtube RSS feeds (and whitelist Youtube iframes)", "fox"); } @@ -12,6 +12,11 @@ class Af_Youtube_Embed extends Plugin { $this->host = $host; $host->add_hook($host::HOOK_RENDER_ENCLOSURE, $this); + $host->add_hook($host::HOOK_IFRAME_WHITELISTED, $this); + } + + function hook_iframe_whitelisted($src) { + return in_array($src, ["www.youtube.com", "youtube.com", "youtu.be"]); } /** |