Make WordPress Core

Ticket #18182: 18182.diff

File 18182.diff, 1.2 KB (added by dd32, 13 years ago)

3.2.x patch and initial 3.3 patch

  • wp-admin/includes/class-wp-upgrader.php

     
    14541454                        $this->package = $uploads['basedir'] . '/' . $this->filename;
    14551455                }
    14561456        }
     1457
     1458        function cleanup() {
     1459                if ( file_exists($this->package) )
     1460                        return @unlink($this->package);
     1461                return true;
     1462        }
    14571463}
     1464 No newline at end of file
  • wp-admin/update.php

     
    140140                $upgrader = new Plugin_Upgrader( new Plugin_Installer_Skin( compact('type', 'title', 'nonce', 'url') ) );
    141141                $upgrader->install( $file_upload->package );
    142142
     143                $file_upload->cleanup();
     144
    143145                include(ABSPATH . 'wp-admin/admin-footer.php');
    144146
    145147        } elseif ( 'upgrade-theme' == $action ) {
     
    242244                $upgrader = new Theme_Upgrader( new Theme_Installer_Skin( compact('type', 'title', 'nonce', 'url') ) );
    243245                $upgrader->install( $file_upload->package );
    244246
     247                $file_upload->cleanup();
     248
    245249                include(ABSPATH . 'wp-admin/admin-footer.php');
    246250
    247251        } else {