Make WordPress Core


Ignore:
Timestamp:
07/14/2017 05:33:44 PM (7 years ago)
Author:
westonruter
Message:

Media: Restrict appending loop parameter to Vimeo URLs specifically and not all external URLs in Video widget (via shortcode).

Fixes issue where Video widgets embedding external files fail to get recognized due to the presence of the loop param after the video filename, even though it has a recognized extension. Regardless, the loop param is only present to fix a Vimeo issue in ME.js 2.x.

Merges [40892] into the 4.8 branch.
Props timmydcrawford.
Amends [40640].
See #39686, #39994.
Fixes #40977 for 4.8.1.

Location:
branches/4.8
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.8

  • branches/4.8/tests/phpunit/tests/media.php

    r40847 r41054  
    762762
    763763    /**
     764     * @ticket 40977
     765     * @depends test_video_shortcode_body
     766     */
     767    function test_wp_video_shortcode_vimeo_adds_loop() {
     768        $actual = wp_video_shortcode( array(
     769            'src' => 'http://vimeo.com/190372437',
     770        ) );
     771
     772        $this->assertContains( 'src="https://vimeo.com/190372437?loop=0', $actual );
     773    }
     774
     775    /**
     776     * @ticket 40977
     777     * @depends test_video_shortcode_body
     778     */
     779    function test_wp_video_shortcode_vimeo_force_adds_loop_true() {
     780        $actual = wp_video_shortcode( array(
     781            'src' => 'http://vimeo.com/190372437',
     782            'loop' => true,
     783        ) );
     784
     785        $this->assertContains( 'src="https://vimeo.com/190372437?loop=1', $actual );
     786    }
     787
     788    /**
    764789     * Test [video] shortcode processing
    765790     *
Note: See TracChangeset for help on using the changeset viewer.