Make WordPress Core


Ignore:
Timestamp:
05/02/2012 08:58:57 PM (12 years ago)
Author:
nacin
Message:

In image_resize(), do not force the destination filename to *.jpg when we are dealing with a *.jpeg.

props SergeyBiryukov.
fixes #16458.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/media.php

    r20694 r20701  
    463463    } else {
    464464        // all other formats are converted to jpg
    465         $destfilename = "{$dir}/{$name}-{$suffix}.jpg";
     465        if ( 'jpg' != $ext && 'jpeg' != $ext )
     466            $destfilename = "{$dir}/{$name}-{$suffix}.jpg";
    466467        if ( !imagejpeg( $newimage, $destfilename, apply_filters( 'jpeg_quality', $jpeg_quality, 'image_resize' ) ) )
    467468            return new WP_Error('resize_path_invalid', __( 'Resize path invalid' ));
Note: See TracChangeset for help on using the changeset viewer.