From 02d80201fa5b4625fe964b30d703a9a144ed5a1a 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: http://core.svn.wordpress.org/trunk@22553 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- 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;