WordPress.org

Make WordPress Core

Ticket #3219: 3219.diff

File 3219.diff, 1.2 KB (added by mdawaffe, 12 years ago)

lame patch for "import" mime type

  • wp-includes/post-template.php

     
    349349
    350350        $file = get_post_meta($post->ID, '_wp_attached_file', true);
    351351
     352        $exts = array('jpg', 'gif', 'png');
     353
    352354        if ( !$fullsize && !empty($imagedata['thumb'])
    353355                        && ($thumbfile = str_replace(basename($file), $imagedata['thumb'], $file))
    354356                        && file_exists($thumbfile) ) {
     
    359361                $src_file = $thumbfile;
    360362                $class = 'attachmentthumb';
    361363
    362         } elseif ( substr($mime, 0, 6) == 'image/'
     364        } elseif ( ( substr($mime, 0, 6) == 'image/' || 'import' == $mime && in_array(substr($file, -3), $exts) )
    363365                        && file_exists($file) ) {
    364366
    365367                // We have an image without a thumbnail
     
    374376                $icon_dir_uri = apply_filters('icon_dir_uri', get_template_directory_uri().'/images');
    375377
    376378                $types = array(substr($mime, 0, strpos($mime, '/')), substr($mime, strpos($mime, '/') + 1), str_replace('/', '_', $mime));
    377                 $exts = array('jpg', 'gif', 'png');
    378379                foreach ($types as $type) {
    379380                        foreach ($exts as $ext) {
    380381                                $src_file = "$icon_dir/$type.$ext";