From 55543163fea5cac721170a6e9466afb8fddeedde Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Tue, 13 Nov 2012 00:03:55 +0000 Subject: [PATCH] In wp_crop_image(), preserve both src_file and src. src_file must be preserved even when url fopen is used so that we don't try to save to a filename based on the url. see #6821 git-svn-id: https://develop.svn.wordpress.org/trunk@22553 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/includes/image.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/wp-admin/includes/image.php b/wp-admin/includes/image.php index 5e9cfd1361..6eca7ba858 100644 --- a/wp-admin/includes/image.php +++ b/wp-admin/includes/image.php @@ -30,11 +30,13 @@ function wp_crop_image( $src, $src_x, $src_y, $src_w, $src_h, $dst_w, $dst_h, $s if ( ! file_exists( $src_file ) ) { // If the file doesn't exist, attempt a url fopen on the src link. // This can occur with certain file replication plugins. - $src_file = _load_image_to_edit_path( $src, 'full' ); + $src = _load_image_to_edit_path( $src, 'full' ); + } else { + $src = $src_file; } } - $editor = WP_Image_Editor::get_instance( $src_file ); + $editor = WP_Image_Editor::get_instance( $src ); if ( is_wp_error( $editor ) ) return $editor;