WordPress.org

Make WordPress Core

Ticket #14963: class-wp-upgrader.php.15659.diff

File class-wp-upgrader.php.15659.diff, 661 bytes (added by joelhardi, 4 years ago)

patch to check that zip package is downloaded copy before unlinking it

  • class-wp-upgrader.php

     
    303303                } 
    304304 
    305305                //Unzip's the file into a temporary directory 
    306                 $working_dir = $this->unpack_package( $download ); 
     306                if ( $package == $download ) 
     307                        $delete_package = false; // local file, don't delete 
     308                else 
     309                        $delete_package = true; // remote file, delete local copy after extracting 
     310                $working_dir = $this->unpack_package( $download, $delete_package ); 
    307311                if ( is_wp_error($working_dir) ) { 
    308312                        $this->skin->error($working_dir); 
    309313                        $this->skin->after();