Make WordPress Core


Ignore:
Timestamp:
11/30/2014 06:32:16 AM (11 years ago)
Author:
wonderboymusic
Message:

Adjust the RegEx in wp_check_filetype() to be aware that query strings are thing that exist sometimes in URLs.

Adds unit tests.

Props voldemortensen.
Fixes #30377.

File:
1 edited

Legend:

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

    r30614 r30640  
    20502050
    20512051    foreach ( $mimes as $ext_preg => $mime_match ) {
    2052         $ext_preg = '!\.(' . $ext_preg . ')$!i';
     2052        $ext_preg = '!\.(' . $ext_preg . ')(\?.*)?$!i';
    20532053        if ( preg_match( $ext_preg, $filename, $ext_matches ) ) {
    20542054            $type = $mime_match;
Note: See TracChangeset for help on using the changeset viewer.