Make WordPress Core

Changeset 4552


Ignore:
Timestamp:
11/30/2006 01:56:06 AM (20 years ago)
Author:
ryan
Message:

Don't use 'import' as a mime type. Props mdawaffe and westi. fixes #3219

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-functions.php

    r4550 r4552  
    19831983
    19841984        $url = $file['url'];
     1985        $type = $file['type'];
    19851986        $file = addslashes( $file['file'] );
    19861987        $filename = basename( $file );
     
    19891990        $object = array( 'post_title' => $filename,
    19901991                'post_content' => $url,
    1991                 'post_mime_type' => 'import',
     1992                'post_mime_type' => $type,
    19921993                'guid' => $url
    19931994        );
  • trunk/wp-includes/post-template.php

    r4402 r4552  
    352352        $file = get_post_meta($post->ID, '_wp_attached_file', true);
    353353
     354        $exts = array('jpg', 'gif', 'png');
     355
    354356        if ( !$fullsize && !empty($imagedata['thumb'])
    355357                        && ($thumbfile = str_replace(basename($file), $imagedata['thumb'], $file))
     
    362364                $class = 'attachmentthumb';
    363365
    364         } elseif ( substr($mime, 0, 6) == 'image/'
     366        } elseif ( ( substr($mime, 0, 6) == 'image/' || 'import' == $mime && in_array(substr($file, -3), $exts) )
    365367                        && file_exists($file) ) {
    366368
     
    377379
    378380                $types = array(substr($mime, 0, strpos($mime, '/')), substr($mime, strpos($mime, '/') + 1), str_replace('/', '_', $mime));
    379                 $exts = array('jpg', 'gif', 'png');
    380381                foreach ($types as $type) {
    381382                        foreach ($exts as $ext) {
Note: See TracChangeset for help on using the changeset viewer.