From 4ee6b4d663f49affa0e6fa68733de431d9416754 Mon Sep 17 00:00:00 2001 From: Ron Rennick Date: Sat, 29 May 2010 18:21:30 +0000 Subject: [PATCH] check both wordpress & wordpress-mu roots in update core, see #13625 git-svn-id: https://develop.svn.wordpress.org/trunk@15059 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/includes/update-core.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/wp-admin/includes/update-core.php b/wp-admin/includes/update-core.php index e42162d0d4..7100524ea4 100644 --- a/wp-admin/includes/update-core.php +++ b/wp-admin/includes/update-core.php @@ -290,8 +290,16 @@ function update_core($from, $to) { // Sanity check the unzipped distribution apply_filters('update_feedback', __('Verifying the unpacked files…')); - if ( !$wp_filesystem->exists($from . '/wordpress/wp-settings.php') || !$wp_filesystem->exists($from . '/wordpress/wp-admin/admin.php') || - !$wp_filesystem->exists($from . '/wordpress/wp-includes/functions.php') ) { + $distro = ''; + $roots = array( '/wordpress', '/wordpress-mu' ); + foreach( $roots as $root ) { + if ( $wp_filesystem->exists($from . $root . '/wp-settings.php') && $wp_filesystem->exists($from . $root . '/wp-admin/admin.php') && + !$wp_filesystem->exists($from . $root . '/wp-includes/functions.php') ) { + $distro = $root; + break; + } + } + if ( !$distro ) { $wp_filesystem->delete($from, true); return new WP_Error('insane_distro', __('The update could not be unpacked') ); } @@ -305,7 +313,7 @@ function update_core($from, $to) { $wp_filesystem->put_contents($maintenance_file, $maintenance_string, FS_CHMOD_FILE); // Copy new versions of WP files into place. - $result = copy_dir($from . '/wordpress', $to); + $result = copy_dir($from . $distro, $to); if ( is_wp_error($result) ) { $wp_filesystem->delete($maintenance_file); $wp_filesystem->delete($from, true);