mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-27 18:16:08 +00:00
Only unset() after we have confirmed we are not dealing with a WP_Error. props DH-Shredder. fixes #22824.
Merges [23133] to the 3.5 branch. git-svn-id: http://core.svn.wordpress.org/branches/3.5@23136 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
commit
438bf33ba9
@ -190,10 +190,11 @@ class WP_Image_Editor_GD extends WP_Image_Editor {
|
||||
$resized = $this->_save( $image );
|
||||
|
||||
imagedestroy( $image );
|
||||
unset( $resized['path'] );
|
||||
|
||||
if ( ! is_wp_error( $resized ) && $resized )
|
||||
if ( ! is_wp_error( $resized ) && $resized ) {
|
||||
unset( $resized['path'] );
|
||||
$metadata[$size] = $resized;
|
||||
}
|
||||
}
|
||||
|
||||
$this->size = $orig_size;
|
||||
|
@ -268,10 +268,11 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor {
|
||||
$this->image->clear();
|
||||
$this->image->destroy();
|
||||
$this->image = null;
|
||||
unset( $resized['path'] );
|
||||
|
||||
if ( ! is_wp_error( $resized ) && $resized )
|
||||
if ( ! is_wp_error( $resized ) && $resized ) {
|
||||
unset( $resized['path'] );
|
||||
$metadata[$size] = $resized;
|
||||
}
|
||||
}
|
||||
|
||||
$this->size = $orig_size;
|
||||
|
Loading…
x
Reference in New Issue
Block a user