mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-05 02:10:45 +01:00
New, better error message when we realize we won't be able to copy a file and continue with the update.
fixes #25652. Built from https://develop.svn.wordpress.org/trunk@25870 git-svn-id: http://core.svn.wordpress.org/trunk@25870 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
d61e188f23
commit
bed7a78426
@ -1371,7 +1371,7 @@ class Core_Upgrader extends WP_Upgrader {
|
||||
// Copy update-core.php from the new version into place.
|
||||
if ( !$wp_filesystem->copy($working_dir . '/wordpress/wp-admin/includes/update-core.php', $wp_dir . 'wp-admin/includes/update-core.php', true) ) {
|
||||
$wp_filesystem->delete($working_dir, true);
|
||||
return new WP_Error( 'copy_failed_for_update_core_file', $this->strings['copy_failed'] );
|
||||
return new WP_Error( 'copy_failed_for_update_core_file', __( 'The update cannot be installed because we will be unable to copy certain files. This is usually due to inconsistent file permissions.' ), 'wp-admin/includes/update-core.php' );
|
||||
}
|
||||
$wp_filesystem->chmod($wp_dir . 'wp-admin/includes/update-core.php', FS_CHMOD_FILE);
|
||||
|
||||
|
@ -661,7 +661,7 @@ function update_core($from, $to) {
|
||||
$versions_file = trailingslashit( $wp_filesystem->wp_content_dir() ) . 'upgrade/version-current.php';
|
||||
if ( ! $wp_filesystem->copy( $from . $distro . 'wp-includes/version.php', $versions_file ) ) {
|
||||
$wp_filesystem->delete( $from, true );
|
||||
return new WP_Error( 'copy_failed_for_version_file', __( 'Could not copy file.' ) );
|
||||
return new WP_Error( 'copy_failed_for_version_file', __( 'The update cannot be installed because we will be unable to copy certain files. This is usually due to inconsistent file permissions.' ), 'wp-includes/version.php' );
|
||||
}
|
||||
|
||||
$wp_filesystem->chmod( $versions_file, FS_CHMOD_FILE );
|
||||
@ -729,7 +729,7 @@ function update_core($from, $to) {
|
||||
$error_data = version_compare( $old_wp_version, '3.7-beta2', '>' ) ? array_keys( $files_not_writable ) : '';
|
||||
|
||||
if ( $files_not_writable )
|
||||
return new WP_Error( 'files_not_writable', __( 'Could not copy file.' ), $error_data );
|
||||
return new WP_Error( 'files_not_writable', __( 'The update cannot be installed because we will be unable to copy certain files. This is usually due to inconsistent file permissions.' ), implode( ', ', $error_data ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user