diff options
author | kdan <[email protected]> | 2021-05-11 11:05:20 +0300 |
---|---|---|
committer | kdan <[email protected]> | 2021-05-11 11:05:20 +0300 |
commit | 2ccf0e50a25086bb81155492ee9ebd1ac755c035 (patch) | |
tree | 7ad648695adb52632a08f9958176c339f5dbba5e /plugins/af_youtube_embed | |
parent | acf0e0d266add0566e41b28946ee73fa01022255 (diff) | |
parent | b2f888e3868c3703819e8acc1519e44d57a53259 (diff) |
Merge branch 'master' into master
Diffstat (limited to 'plugins/af_youtube_embed')
-rw-r--r-- | plugins/af_youtube_embed/init.php | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/plugins/af_youtube_embed/init.php b/plugins/af_youtube_embed/init.php index 95ab0b9d5..72d25a826 100644 --- a/plugins/af_youtube_embed/init.php +++ b/plugins/af_youtube_embed/init.php @@ -16,18 +16,16 @@ class Af_Youtube_Embed extends Plugin { } function hook_iframe_whitelisted($src) { - return in_array($src, ["www.youtube.com", "youtube.com", "youtu.be"]); + return in_array($src, ["www.youtube.com", "youtube.com", + "www.youtube-nocookie.com", "youtube-nocookie.com", + "youtu.be"]); } function hook_render_enclosure($entry, $hide_images) { - $matches = array(); + $url = $entry["content_url"]; - if (preg_match("/\/\/www\.youtube\.com\/v\/([\w-]+)/", $entry["content_url"], $matches) || - preg_match("/\/\/www\.youtube\.com\/watch?v=([\w-]+)/", $entry["content_url"], $matches) || - preg_match("/\/\/youtu.be\/([\w-]+)/", $entry["content_url"], $matches)) { - - $vid_id = $matches[1]; + if ($vid_id = UrlHelper::url_to_youtube_vid($url)) { return "<div class='embed-responsive'> <iframe class='youtube-player' |