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-includes/post.php

    r21213 r21219  
    40374037    $ext = preg_match('/\.([^.]+)$/', $file, $matches) ? strtolower($matches[1]) : false;
    40384038
    4039     $image_exts = array('jpg', 'jpeg', 'gif', 'png');
     4039    $image_exts = array( 'jpg', 'jpeg', 'jpe', 'gif', 'png' );
    40404040
    40414041    if ( 'image/' == substr($post->post_mime_type, 0, 6) || $ext && 'import' == $post->post_mime_type && in_array($ext, $image_exts) )
Note: See TracChangeset for help on using the changeset viewer.