Widgets: Normalize YouTube and Vimeo URLs in video shortcode (primarily for Video widget) to work around ME.js 2.22 bug.

Props timmydcrawford, jnylen0, westonruter.
See #32417, #39994.
Fixes #40866.


git-svn-id: https://develop.svn.wordpress.org/trunk@40847 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Weston Ruter
2017-05-26 23:09:42 +00:00
parent 31c9647279
commit 289965b097
2 changed files with 51 additions and 0 deletions
+37
View File
@@ -723,6 +723,43 @@ VIDEO;
$this->assertContains( 'class="foobar"', $actual );
}
/**
* @ticket 40866
* @depends test_video_shortcode_body
*/
function test_wp_video_shortcode_youtube_remove_feature() {
$actual = wp_video_shortcode( array(
'src' => 'https://www.youtube.com/watch?v=i_cVJgIz_Cs&feature=youtu.be',
) );
$this->assertNotContains( 'feature=youtu.be', $actual );
}
/**
* @ticket 40866
* @depends test_video_shortcode_body
*/
function test_wp_video_shortcode_youtube_force_ssl() {
$actual = wp_video_shortcode( array(
'src' => 'http://www.youtube.com/watch?v=i_cVJgIz_Cs',
) );
$this->assertContains( 'src="https://www.youtube.com/watch?v=i_cVJgIz_Cs', $actual );
}
/**
* @ticket 40866
* @depends test_video_shortcode_body
*/
function test_wp_video_shortcode_vimeo_force_ssl_remove_query_args() {
$actual = wp_video_shortcode( array(
'src' => 'http://vimeo.com/190372437?blah=meh',
) );
$this->assertContains( 'src="https://vimeo.com/190372437', $actual );
$this->assertNotContains( 'blah=meh', $actual );
}
/**
* Test [video] shortcode processing
*