Make WordPress Core


Ignore:
Timestamp:
05/26/2017 11:09:42 PM (8 years ago)
Author:
westonruter
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/media.php

    r40809 r40847  
    725725
    726726    /**
     727     * @ticket 40866
     728     * @depends test_video_shortcode_body
     729     */
     730    function test_wp_video_shortcode_youtube_remove_feature() {
     731        $actual = wp_video_shortcode( array(
     732            'src' => 'https://www.youtube.com/watch?v=i_cVJgIz_Cs&feature=youtu.be',
     733        ) );
     734
     735        $this->assertNotContains( 'feature=youtu.be', $actual );
     736    }
     737
     738    /**
     739     * @ticket 40866
     740     * @depends test_video_shortcode_body
     741     */
     742    function test_wp_video_shortcode_youtube_force_ssl() {
     743        $actual = wp_video_shortcode( array(
     744            'src' => 'http://www.youtube.com/watch?v=i_cVJgIz_Cs',
     745        ) );
     746
     747        $this->assertContains( 'src="https://www.youtube.com/watch?v=i_cVJgIz_Cs', $actual );
     748    }
     749
     750    /**
     751     * @ticket 40866
     752     * @depends test_video_shortcode_body
     753     */
     754    function test_wp_video_shortcode_vimeo_force_ssl_remove_query_args() {
     755        $actual = wp_video_shortcode( array(
     756            'src' => 'http://vimeo.com/190372437?blah=meh',
     757        ) );
     758
     759        $this->assertContains( 'src="https://vimeo.com/190372437', $actual );
     760        $this->assertNotContains( 'blah=meh', $actual );
     761    }
     762
     763    /**
    727764     * Test [video] shortcode processing
    728765     *
Note: See TracChangeset for help on using the changeset viewer.