From f73508e9bc0e43155bbffbd75a173e7164b84f12 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Fri, 17 Jan 2014 19:46:11 +0000 Subject: [PATCH] Ensure that SSL YouTube URLs receive SSL embeds. props adamsilverstein, Otto42, JayCC. fixes #23149. Built from https://develop.svn.wordpress.org/trunk@26978 git-svn-id: http://core.svn.wordpress.org/trunk@26855 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-oembed.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/wp-includes/class-oembed.php b/wp-includes/class-oembed.php index e465a6d1a3..15b62b5085 100644 --- a/wp-includes/class-oembed.php +++ b/wp-includes/class-oembed.php @@ -27,8 +27,10 @@ class WP_oEmbed { */ function __construct() { $providers = array( - '#https?://(www\.)?youtube\.com/watch.*#i' => array( 'http://www.youtube.com/oembed', true ), - 'http://youtu.be/*' => array( 'http://www.youtube.com/oembed', false ), + '#http://(www\.)?youtube\.com/watch.*#i' => array( 'http://www.youtube.com/oembed', true ), + '#https://(www\.)?youtube\.com/watch.*#i' => array( 'http://www.youtube.com/oembed?scheme=https', true ), + '#http://youtu\.be/.*#i' => array( 'http://www.youtube.com/oembed', true ), + '#https://youtu\.be/.*#i' => array( 'http://www.youtube.com/oembed?scheme=https', true ), 'http://blip.tv/*' => array( 'http://blip.tv/oembed/', false ), '#https?://(www\.)?vimeo\.com/.*#i' => array( 'http://vimeo.com/api/oembed.{format}', true ), '#https?://(www\.)?dailymotion\.com/.*#i' => array( 'http://www.dailymotion.com/services/oembed', true ), @@ -54,6 +56,7 @@ class WP_oEmbed { '#https?://rd\.io/x/.*#i' => array( 'http://www.rdio.com/api/oembed/', true ), '#https?://(open|play)\.spotify\.com/.*#i' => array( 'https://embed.spotify.com/oembed/', true ), ); + /** * Filter the list of oEmbed providers. *