Only unset() after we have confirmed we are not dealing with a WP_Error. props DH-Shredder. fixes #22824.
git-svn-id: https://develop.svn.wordpress.org/trunk@23133 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
26bb121ddf
commit
f9d1ca1da4
@ -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…
Reference in New Issue
Block a user