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

git-svn-id: http://svn.automattic.com/wordpress/trunk@15059 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
wpmuguru 2010-05-29 18:21:30 +00:00
parent 910946a2f4
commit e1a7369889
1 changed files with 11 additions and 3 deletions

View File

@ -290,8 +290,16 @@ function update_core($from, $to) {
// Sanity check the unzipped distribution // Sanity check the unzipped distribution
apply_filters('update_feedback', __('Verifying the unpacked files…')); 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') || $distro = '';
!$wp_filesystem->exists($from . '/wordpress/wp-includes/functions.php') ) { $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); $wp_filesystem->delete($from, true);
return new WP_Error('insane_distro', __('The update could not be unpacked') ); 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); $wp_filesystem->put_contents($maintenance_file, $maintenance_string, FS_CHMOD_FILE);
// Copy new versions of WP files into place. // 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) ) { if ( is_wp_error($result) ) {
$wp_filesystem->delete($maintenance_file); $wp_filesystem->delete($maintenance_file);
$wp_filesystem->delete($from, true); $wp_filesystem->delete($from, true);