Ticket #30377: 30377.diff
File 30377.diff, 1.1 KB (added by , 10 years ago) |
---|
-
tests/phpunit/tests/media.php
443 443 $this->assertTrue( has_image_size( 'test-size' ) ); 444 444 } 445 445 446 function test_wp_check_filetype() { 447 $url = 'http://example.com/testFile.mp4?autoplay=true&otherstuff=false'; 448 $filetype = wp_check_filetype( $url ); 449 $expected = array( 450 'ext' => 'mp4', 451 'type' => 'video/mp4' 452 ); 453 $this->assertEquals( $expected, $filetype ); 454 } 446 455 } -
src/wp-includes/functions.php
2049 2049 $ext = false; 2050 2050 2051 2051 foreach ( $mimes as $ext_preg => $mime_match ) { 2052 $ext_preg = '!\.(' . $ext_preg . ') $!i';2052 $ext_preg = '!\.(' . $ext_preg . ')(\?.*)?$!i'; 2053 2053 if ( preg_match( $ext_preg, $filename, $ext_matches ) ) { 2054 2054 $type = $mime_match; 2055 2055 $ext = $ext_matches[1];