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/press-this.php

    r21204 r21219  
    173173        function get_images_from_uri($uri) {
    174174            $uri = preg_replace('/\/#.+?$/','', $uri);
    175             if ( preg_match('/\.(jpg|jpe|jpeg|png|gif)$/', $uri) && !strpos($uri,'blogger.com') )
     175            if ( preg_match( '/\.(jpe?g|jpe|gif|png)\b/i', $uri ) && !strpos( $uri, 'blogger.com' ) )
    176176                return "'" . esc_attr( html_entity_decode($uri) ) . "'";
    177177            $content = wp_remote_fopen($uri);
Note: See TracChangeset for help on using the changeset viewer.