Make WordPress Core

Changeset 18517


Ignore:
Timestamp:
08/06/2011 09:04:15 PM (14 years ago)
Author:
azaozz
Message:

Fix handling of resizing images after upload, props ocean90, see #18206

Location:
trunk/wp-admin/includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/file.php

    r18482 r18517  
    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( $_POST['image_resize'] ) && 'true' == $_POST['image_resize'];
     334    $do_resize = apply_filters( 'wp_upload_resize', $image_resize );
    334335    $size = @getimagesize( $tmp_file );
    335336    if ( $do_resize && $size ) {
  • trunk/wp-admin/includes/media.php

    r18516 r18517  
    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>
     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' ), (int) get_option( 'large_size_w' ), (int) get_option( 'large_size_h' ) ); ?>
     2289</label>
    22882290<?php
    22892291}
Note: See TracChangeset for help on using the changeset viewer.