WordPress.org

Make WordPress Core

Changeset 23133


Ignore:
Timestamp:
12/09/12 17:02:22 (17 months ago)
Author:
nacin
Message:

Only unset() after we have confirmed we are not dealing with a WP_Error. props DH-Shredder. fixes #22824.

Location:
trunk/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/class-wp-image-editor-gd.php

    r23103 r23133  
    191191 
    192192                imagedestroy( $image ); 
    193                 unset( $resized['path'] ); 
    194  
    195                 if ( ! is_wp_error( $resized ) && $resized ) 
     193 
     194                if ( ! is_wp_error( $resized ) && $resized ) { 
     195                    unset( $resized['path'] ); 
    196196                    $metadata[$size] = $resized; 
     197                } 
    197198            } 
    198199 
  • trunk/wp-includes/class-wp-image-editor-imagick.php

    r23103 r23133  
    269269                $this->image->destroy(); 
    270270                $this->image = null; 
    271                 unset( $resized['path'] ); 
    272  
    273                 if ( ! is_wp_error( $resized ) && $resized ) 
     271 
     272                if ( ! is_wp_error( $resized ) && $resized ) { 
     273                    unset( $resized['path'] ); 
    274274                    $metadata[$size] = $resized; 
     275                } 
    275276            } 
    276277 
Note: See TracChangeset for help on using the changeset viewer.