WordPress.org

Make WordPress Core

Changeset 18713


Ignore:
Timestamp:
09/19/2011 04:54:04 AM (7 years ago)
Author:
dd32
Message:

Only clean up the uploaded files after a successful (or failed) install. Allows files to persist past the FTP credential screen. See #18182

Location:
branches/3.2/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/3.2/wp-admin/includes/class-wp-upgrader.php

    r18615 r18713  
    400400                    ));
    401401
     402        if ( ! $this->result || is_wp_error($this->result) )
     403            return $this->result;
     404
    402405        // Force refresh of plugin update information
    403406        delete_site_transient('update_plugins');
    404407
     408        return true;
    405409    }
    406410
     
    646650        delete_site_transient('update_themes');
    647651
    648         if ( empty($result['destination_name']) )
    649             return false;
    650         else
    651             return $result['destination_name'];
     652        return true;
    652653    }
    653654
  • branches/3.2/wp-admin/update.php

    r18615 r18713  
    139139
    140140        $upgrader = new Plugin_Upgrader( new Plugin_Installer_Skin( compact('type', 'title', 'nonce', 'url') ) );
    141         $upgrader->install( $file_upload->package );
    142 
    143         $file_upload->cleanup();
     141        $result = $upgrader->install( $file_upload->package );
     142
     143        if ( $result || is_wp_error($result) )
     144            $file_upload->cleanup();
    144145
    145146        include(ABSPATH . 'wp-admin/admin-footer.php');
     
    243244
    244245        $upgrader = new Theme_Upgrader( new Theme_Installer_Skin( compact('type', 'title', 'nonce', 'url') ) );
    245         $upgrader->install( $file_upload->package );
    246 
    247         $file_upload->cleanup();
     246        $result = $upgrader->install( $file_upload->package );
     247
     248        if ( $result || is_wp_error($result) )
     249            $file_upload->cleanup();
    248250
    249251        include(ABSPATH . 'wp-admin/admin-footer.php');
Note: See TracChangeset for help on using the changeset viewer.