Make WordPress Core

Ticket #18206: 18206.fix.resize.patch

File 18206.fix.resize.patch, 1.4 KB (added by ocean90, 13 years ago)
  • wp-admin/includes/file.php

     
    330330                return $upload_error_handler( $file, sprintf( __('The uploaded file could not be moved to %s.' ), $uploads['path'] ) );
    331331
    332332        // If a resize was requested, perform the resize.
    333         $do_resize = apply_filters( 'wp_upload_resize', isset( $_REQUEST['image_resize'] ) );
     333        $image_resize = isset( $_REQUEST['image_resize'] ) && 'true' == $_POST['image_resize'] ? true : false;
     334        $do_resize = apply_filters( 'wp_upload_resize', $image_resize );
    334335        $size = @getimagesize( $tmp_file );
    335336        if ( $do_resize && $size ) {
    336337                $old_temp = $tmp_file;
  • wp-admin/includes/media.php

     
    22832283 */
    22842284function media_upload_max_image_resize() {
    22852285?>
    2286 <input name="image_resize" type="checkbox" id="image_resize" value="1" />
    2287 <label for="image_resize"><?php printf( __( 'Scale images to max width %1$dpx or max height %2$dpx'), get_option('large_size_w'), get_option('large_size_h') ); ?></label>
     2286<label for="image_resize">
     2287<input name="image_resize" type="checkbox" id="image_resize" value="true" />
     2288<?php printf( __( 'Scale images to max width %1$dpx or max height %2$dpx' ), get_option( 'large_size_w' ), get_option( 'large_size_h' ) ); ?>
     2289</label>
    22882290<?php
    22892291}
    22902292