WordPress.org

Make WordPress Core

Ticket #16458: 16458.4.diff

File 16458.4.diff, 673 bytes (added by ryan, 6 years ago)

Alternative suggested by nacin

  • wp-includes/media.php

     
    462462                        return new WP_Error('resize_path_invalid', __( 'Resize path invalid' ));
    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' ));
    468469        }