Ticket #40977: 40977.1.diff
File 40977.1.diff, 2.3 KB (added by , 7 years ago) |
---|
-
src/wp-includes/media.php
2556 2556 } elseif ( $is_vimeo ) { 2557 2557 // Remove all query arguments and force SSL - see #40866. 2558 2558 $parsed_vimeo_url = wp_parse_url( $atts['src'] ); 2559 $atts['src'] = 'https://' . $parsed_vimeo_url['host'] . $parsed_vimeo_url['path']; 2559 $vimeo_src = 'https://' . $parsed_vimeo_url['host'] . $parsed_vimeo_url['path']; 2560 2561 // Add loop param for mejs bug - see #40977, not needed after #39686. 2562 $loop = $atts['loop'] ? '1' : '0'; 2563 $atts['src'] = add_query_arg( 'loop', $loop, $vimeo_src ); 2560 2564 } 2561 2565 } 2562 2566 -
src/wp-includes/widgets/class-wp-widget-media-video.php
115 115 $attachment = get_post( $instance['attachment_id'] ); 116 116 } 117 117 118 $src = $instance['url']; 118 119 if ( $attachment ) { 119 120 $src = wp_get_attachment_url( $attachment->ID ); 120 } else {121 122 // Manually add the loop query argument.123 $loop = $instance['loop'] ? '1' : '0';124 $src = empty( $instance['url'] ) ? $instance['url'] : add_query_arg( 'loop', $loop, $instance['url'] );125 121 } 126 122 127 123 if ( empty( $src ) ) { -
tests/phpunit/tests/media.php
761 761 } 762 762 763 763 /** 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 /** 764 789 * Test [video] shortcode processing 765 790 * 766 791 */