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
This commit is contained in:
Ron Rennick 2010-05-29 18:21:30 +00:00
parent 5b4a393be3
commit 4ee6b4d663
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
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);