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
This commit is contained in:
Ryan Boren 2012-11-13 00:03:55 +00:00
parent 4ee51a98cb
commit 55543163fe
1 changed files with 4 additions and 2 deletions

View File

@ -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;