Af_Youtube_Embed: whitelist youtube iframes if enabled
This commit is contained in:
parent
d15f0349bf
commit
219840341c
|
@ -4,7 +4,7 @@ class Af_Youtube_Embed extends Plugin {
|
||||||
|
|
||||||
function about() {
|
function about() {
|
||||||
return array(1.0,
|
return array(1.0,
|
||||||
"Embed videos in Youtube RSS feeds",
|
"Embed videos in Youtube RSS feeds (and whitelist Youtube iframes)",
|
||||||
"fox");
|
"fox");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,6 +12,11 @@ class Af_Youtube_Embed extends Plugin {
|
||||||
$this->host = $host;
|
$this->host = $host;
|
||||||
|
|
||||||
$host->add_hook($host::HOOK_RENDER_ENCLOSURE, $this);
|
$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"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue