YouTube oEmbed parsing: support the m subdomain.

Adds unit tests.

Props Toru, johnbillion.
Fixes #32714.


git-svn-id: https://develop.svn.wordpress.org/trunk@32930 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor
2015-06-24 21:05:59 +00:00
parent 2ddca22b66
commit ac63fb4dc3
2 changed files with 17 additions and 4 deletions
+13
View File
@@ -130,6 +130,19 @@ CAP;
$this->assertContains( 'https://www.youtube.com/embed/zHjMoNQN7s0?feature=oembed', $out );
}
/**
* Test m.youtube.com embeds
*
* @ticket 32714
*/
function test_youtube_com_mobile_embed() {
$out = wp_oembed_get( 'http://m.youtube.com/watch?v=oHg5SJYRHA0' );
$this->assertContains( 'https://www.youtube.com/embed/oHg5SJYRHA0?feature=oembed', $out );
$out = wp_oembed_get( 'https://m.youtube.com/watch?v=oHg5SJYRHA0' );
$this->assertContains( 'https://www.youtube.com/embed/oHg5SJYRHA0?feature=oembed', $out );
}
function test_youtube_embed_url() {
global $wp_embed;
$out = $wp_embed->autoembed( 'https://www.youtube.com/embed/QcIy9NiNbmo' );