WordPress.org

Make WordPress Core

Changeset 15059


Ignore:
Timestamp:
05/29/10 18:21:30 (5 years ago)
Author:
wpmuguru
Message:

check both wordpress & wordpress-mu roots in update core, see #13625

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/update-core.php

    r15057 r15059  
    291291    // Sanity check the unzipped distribution 
    292292    apply_filters('update_feedback', __('Verifying the unpacked files…')); 
    293     if ( !$wp_filesystem->exists($from . '/wordpress/wp-settings.php') || !$wp_filesystem->exists($from . '/wordpress/wp-admin/admin.php') || 
    294         !$wp_filesystem->exists($from . '/wordpress/wp-includes/functions.php') ) { 
     293    $distro = ''; 
     294    $roots = array( '/wordpress', '/wordpress-mu' ); 
     295    foreach( $roots as $root ) { 
     296        if ( $wp_filesystem->exists($from . $root . '/wp-settings.php') && $wp_filesystem->exists($from . $root . '/wp-admin/admin.php') && 
     297            !$wp_filesystem->exists($from . $root . '/wp-includes/functions.php') ) { 
     298            $distro = $root; 
     299            break; 
     300        } 
     301    } 
     302    if ( !$distro ) { 
    295303        $wp_filesystem->delete($from, true); 
    296304        return new WP_Error('insane_distro', __('The update could not be unpacked') ); 
     
    306314 
    307315    // Copy new versions of WP files into place. 
    308     $result = copy_dir($from . '/wordpress', $to); 
     316    $result = copy_dir($from . $distro, $to); 
    309317    if ( is_wp_error($result) ) { 
    310318        $wp_filesystem->delete($maintenance_file); 
Note: See TracChangeset for help on using the changeset viewer.