WordPress.org

Make WordPress Core


Ignore:
Timestamp:
07/05/2012 08:51:55 PM (7 years ago)
Author:
markjaquith
Message:

Better image extension regexes, so we don't just grab the "jpe" from "jpeg" files in media_sideload_image(). props sivel. fixes #16693

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/media.php

    r21171 r21219  
    600600        // Set variables for storage
    601601        // fix file filename for query strings
    602         preg_match('/[^\?]+\.(jpg|JPG|jpe|JPE|jpeg|JPEG|gif|GIF|png|PNG)/', $file, $matches);
     602        preg_match( '/[^\?]+\.(jpe?g|jpe|gif|png)\b/i', $file, $matches );
    603603        $file_array['name'] = basename($matches[0]);
    604604        $file_array['tmp_name'] = $tmp;
Note: See TracChangeset for help on using the changeset viewer.