WordPress.org

Make WordPress Core

Changeset 32171


Ignore:
Timestamp:
04/20/2015 06:38:08 AM (5 years ago)
Author:
pento
Message:

Revert [30640], as it was incorrectly checking some filenames.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/functions.php

    r32116 r32171  
    20542054
    20552055    foreach ( $mimes as $ext_preg => $mime_match ) {
    2056         $ext_preg = '!\.(' . $ext_preg . ')(\?.*)?$!i';
     2056        $ext_preg = '!\.(' . $ext_preg . ')$!i';
    20572057        if ( preg_match( $ext_preg, $filename, $ext_matches ) ) {
    20582058            $type = $mime_match;
  • trunk/tests/phpunit/tests/media.php

    r31694 r32171  
    532532    }
    533533
    534     function test_wp_check_filetype() {
    535         $url = 'http://example.com/testFile.mp4?autoplay=true&otherstuff=false';
    536         $filetype = wp_check_filetype( $url );
    537         $expected = array(
    538             'ext'  => 'mp4',
    539             'type' => 'video/mp4'
    540         );
    541         $this->assertEquals( $expected, $filetype );
    542     }
    543 
    544534    /**
    545535     * @ticket 22768
Note: See TracChangeset for help on using the changeset viewer.