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
This commit is contained in:
azaozz 2008-10-12 18:09:44 +00:00
parent 869cd2ffa1
commit 307ec4c10d
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);
}
?>
?>