mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-12-06 12:51:58 +00:00
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:
@@ -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
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user