mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-13 01:55:55 +00:00
remove hardcoded iframe domain whitelist, make iframe script whitelisting configurable by plugins (HOOK_IFRAME_WHITELISTED)
This commit is contained in:
@@ -61,6 +61,7 @@ class PluginHost {
|
||||
const HOOK_GET_FULL_TEXT = 41;
|
||||
const HOOK_ARTICLE_IMAGE = 42;
|
||||
const HOOK_FEED_TREE = 43;
|
||||
const HOOK_IFRAME_WHITELISTED = 44;
|
||||
|
||||
const KIND_ALL = 1;
|
||||
const KIND_SYSTEM = 2;
|
||||
|
||||
@@ -1250,13 +1250,11 @@
|
||||
}
|
||||
|
||||
function iframe_whitelisted($entry) {
|
||||
$whitelist = array("youtube.com", "youtu.be", "vimeo.com", "player.vimeo.com");
|
||||
|
||||
@$src = parse_url($entry->getAttribute("src"), PHP_URL_HOST);
|
||||
|
||||
if ($src) {
|
||||
foreach ($whitelist as $w) {
|
||||
if ($src == $w || $src == "www.$w")
|
||||
foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_IFRAME_WHITELISTED) as $plugin) {
|
||||
if ($plugin->hook_iframe_whitelisted($src))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user