Core update: fix for "The update could not be unpacked" error, props ShaneF, fixes #7861

git-svn-id: https://develop.svn.wordpress.org/trunk@9128 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2008-10-12 18:09:44 +00:00
parent c2178198f4
commit 85c25b4440
1 changed files with 4 additions and 4 deletions

View File

@ -177,8 +177,8 @@ function update_core($from, $to) {
// Sanity check the unzipped distribution
apply_filters('update_feedback', __('Verifying the unpacked files'));
if ( !file_exists($from . '/wordpress/wp-settings.php') || !file_exists($from . '/wordpress/wp-admin/admin.php') ||
!file_exists($from . '/wordpress/wp-includes/functions.php') ) {
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') ) {
$wp_filesystem->delete($from, true);
return new WP_Error('insane_distro', __('The update could not be unpacked') );
}
@ -202,7 +202,7 @@ function update_core($from, $to) {
// Remove old files
foreach ( $_old_files as $old_file ) {
$old_file = $to . $old_file;
if ( !file_exists($old_file) )
if ( !$wp_filesystem->exists($old_file) )
continue;
$wp_filesystem->delete($old_file, true);
}
@ -222,4 +222,4 @@ function update_core($from, $to) {
$wp_filesystem->delete($maintenance_file);
}
?>
?>