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:
parent
910946a2f4
commit
e1a7369889
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue