From 307ec4c10d4ae3a208d0a921758f3f5f4f38119f Mon Sep 17 00:00:00 2001 From: azaozz Date: Sun, 12 Oct 2008 18:09:44 +0000 Subject: [PATCH] Core update: fix for "The update could not be unpacked" error, props ShaneF, fixes #7861 git-svn-id: http://svn.automattic.com/wordpress/trunk@9128 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/update-core.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wp-admin/includes/update-core.php b/wp-admin/includes/update-core.php index 5a072f59c0..a679198ab6 100644 --- a/wp-admin/includes/update-core.php +++ b/wp-admin/includes/update-core.php @@ -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); } -?> \ No newline at end of file +?>