Make WordPress Core

Changeset 18614


Ignore:
Timestamp:
08/28/2011 03:51:35 AM (13 years ago)
Author:
dd32
Message:

Clean up Plugin/Theme uploads after successfully installing them. Restores pre-3.2 behaviour. See #18182

Location:
trunk/wp-admin
Files:
2 edited

Legend:

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

    r18569 r18614  
    14591459        }
    14601460    }
     1461
     1462    function cleanup() {
     1463        if ( file_exists($this->package) )
     1464            return @unlink($this->package);
     1465        return true;
     1466    }
    14611467}
  • trunk/wp-admin/update.php

    r17632 r18614  
    141141        $upgrader->install( $file_upload->package );
    142142
     143        $file_upload->cleanup();
     144
    143145        include(ABSPATH . 'wp-admin/admin-footer.php');
    144146
     
    243245        $upgrader->install( $file_upload->package );
    244246
     247        $file_upload->cleanup();
     248
    245249        include(ABSPATH . 'wp-admin/admin-footer.php');
    246250
Note: See TracChangeset for help on using the changeset viewer.