From b7e35b3f6c0bdcc970337529b4151b3fd158fcc7 Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Sat, 6 Aug 2011 21:04:15 +0000 Subject: [PATCH] Fix handling of resizing images after upload, props ocean90, see #18206 git-svn-id: https://develop.svn.wordpress.org/trunk@18517 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/includes/file.php | 3 ++- wp-admin/includes/media.php | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/wp-admin/includes/file.php b/wp-admin/includes/file.php index 36fbf12961..5e83f40018 100644 --- a/wp-admin/includes/file.php +++ b/wp-admin/includes/file.php @@ -330,7 +330,8 @@ function wp_handle_upload( &$file, $overrides = false, $time = null ) { return $upload_error_handler( $file, sprintf( __('The uploaded file could not be moved to %s.' ), $uploads['path'] ) ); // If a resize was requested, perform the resize. - $do_resize = apply_filters( 'wp_upload_resize', isset( $_REQUEST['image_resize'] ) ); + $image_resize = isset( $_POST['image_resize'] ) && 'true' == $_POST['image_resize']; + $do_resize = apply_filters( 'wp_upload_resize', $image_resize ); $size = @getimagesize( $tmp_file ); if ( $do_resize && $size ) { $old_temp = $tmp_file; diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php index 51310677a5..db000572a9 100644 --- a/wp-admin/includes/media.php +++ b/wp-admin/includes/media.php @@ -2283,8 +2283,10 @@ function _insert_into_post_button($type) { */ function media_upload_max_image_resize() { ?> - - +