WordPress.org

Make WordPress Core

Ticket #16693: 16693.5.diff

File 16693.5.diff, 1.7 KB (added by georgestephanis, 7 years ago)

Updated to current trunk to accomodate for line numbers and such

  • wp-includes/post.php

     
    40334033
    40344034        $ext = preg_match('/\.([^.]+)$/', $file, $matches) ? strtolower($matches[1]) : false;
    40354035
    4036         $image_exts = array('jpg', 'jpeg', 'gif', 'png');
     4036        $image_exts = array( 'jpg', 'jpeg', 'jpe', 'gif', 'png' );
    40374037
    40384038        if ( 'image/' == substr($post->post_mime_type, 0, 6) || $ext && 'import' == $post->post_mime_type && in_array($ext, $image_exts) )
    40394039                return true;
  • wp-admin/includes/media.php

     
    599599
    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;
    605605
  • wp-admin/press-this.php

     
    172172                 */
    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);
    178178                        if ( false === $content )