mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 01:27:36 +01:00
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
This commit is contained in:
parent
8c73f531b9
commit
02d80201fa
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user