WordPress.org

Make WordPress Core

Changeset 4671


Ignore:
Timestamp:
01/02/2007 07:51:36 PM (11 years ago)
Author:
ryan
Message:

Now with less bugs. fixes #3411

Location:
trunk/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/post-template.php

    r4670 r4671  
    350350    $file = get_attached_file( $post->ID );
    351351
    352     $exts = array('jpg', 'gif', 'png');
    353 
    354352    if ( !$fullsize && $thumbfile = wp_get_attachment_thumb_file( $post->ID ) ) {
    355353        // We have a thumbnail desired, specified and existing
  • trunk/wp-includes/post.php

    r4670 r4671  
    14721472        return false;
    14731473
    1474     $image_exts = array('/jpg', 'jpeg', '/gif', '/png');
    1475 
    1476     if ( 'image/' == substr($post->post_mime_type, 0, 6) || 'import' == $post->post_mime_type && in_array(substr($file, -4), $exts) )
     1474    $ext = preg_match('/\.([^.]+)$/', $file, $matches) ? strtolower($matches[1]) : false;
     1475
     1476    $image_exts = array('jpg', 'jpeg', 'gif', 'png');
     1477
     1478    if ( 'image/' == substr($post->post_mime_type, 0, 6) || $ext && 'import' == $post->post_mime_type && in_array($ext, $image_exts) )
    14771479        return true;
    14781480    return false;
Note: See TracChangeset for help on using the changeset viewer.