From 332750a40d4a18a3c90439de6b538fdfca7aa980 Mon Sep 17 00:00:00 2001 From: Gary Pendergast Date: Mon, 20 Apr 2015 06:38:08 +0000 Subject: [PATCH] Revert [30640], as it was incorrectly checking some filenames. git-svn-id: https://develop.svn.wordpress.org/trunk@32171 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/functions.php | 2 +- tests/phpunit/tests/media.php | 10 ---------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/src/wp-includes/functions.php b/src/wp-includes/functions.php index 9a0ee8880a..929c4e218a 100644 --- a/src/wp-includes/functions.php +++ b/src/wp-includes/functions.php @@ -2053,7 +2053,7 @@ function wp_check_filetype( $filename, $mimes = null ) { $ext = false; foreach ( $mimes as $ext_preg => $mime_match ) { - $ext_preg = '!\.(' . $ext_preg . ')(\?.*)?$!i'; + $ext_preg = '!\.(' . $ext_preg . ')$!i'; if ( preg_match( $ext_preg, $filename, $ext_matches ) ) { $type = $mime_match; $ext = $ext_matches[1]; diff --git a/tests/phpunit/tests/media.php b/tests/phpunit/tests/media.php index 57e00a5d3a..14e92af1c2 100644 --- a/tests/phpunit/tests/media.php +++ b/tests/phpunit/tests/media.php @@ -531,16 +531,6 @@ VIDEO; $this->assertEquals( 0, $post_id ); } - function test_wp_check_filetype() { - $url = 'http://example.com/testFile.mp4?autoplay=true&otherstuff=false'; - $filetype = wp_check_filetype( $url ); - $expected = array( - 'ext' => 'mp4', - 'type' => 'video/mp4' - ); - $this->assertEquals( $expected, $filetype ); - } - /** * @ticket 22768 */