wp/wp-admin/includes/class-core-upgrader.php
changeset 19 3d72ae0968f4
parent 18 be944660c56a
child 21 48c4eec2b7e6
equal deleted inserted replaced
18:be944660c56a 19:3d72ae0968f4
   124 		$download = $this->download_package( $current->packages->$to_download, true );
   124 		$download = $this->download_package( $current->packages->$to_download, true );
   125 
   125 
   126 		// Allow for signature soft-fail.
   126 		// Allow for signature soft-fail.
   127 		// WARNING: This may be removed in the future.
   127 		// WARNING: This may be removed in the future.
   128 		if ( is_wp_error( $download ) && $download->get_error_data( 'softfail-filename' ) ) {
   128 		if ( is_wp_error( $download ) && $download->get_error_data( 'softfail-filename' ) ) {
   129 			// Outout the failure error as a normal feedback, and not as an error:
   129 			// Output the failure error as a normal feedback, and not as an error:
   130 			/** This filter is documented in wp-admin/includes/update-core.php */
   130 			/** This filter is documented in wp-admin/includes/update-core.php */
   131 			apply_filters( 'update_feedback', $download->get_error_message() );
   131 			apply_filters( 'update_feedback', $download->get_error_message() );
   132 
   132 
   133 			// Report this failure back to WordPress.org for debugging purposes.
   133 			// Report this failure back to WordPress.org for debugging purposes.
   134 			wp_version_check(
   134 			wp_version_check(
   155 
   155 
   156 		// Copy update-core.php from the new version into place.
   156 		// Copy update-core.php from the new version into place.
   157 		if ( ! $wp_filesystem->copy( $working_dir . '/wordpress/wp-admin/includes/update-core.php', $wp_dir . 'wp-admin/includes/update-core.php', true ) ) {
   157 		if ( ! $wp_filesystem->copy( $working_dir . '/wordpress/wp-admin/includes/update-core.php', $wp_dir . 'wp-admin/includes/update-core.php', true ) ) {
   158 			$wp_filesystem->delete( $working_dir, true );
   158 			$wp_filesystem->delete( $working_dir, true );
   159 			WP_Upgrader::release_lock( 'core_updater' );
   159 			WP_Upgrader::release_lock( 'core_updater' );
   160 			return new WP_Error( 'copy_failed_for_update_core_file', __( 'The update cannot be installed because we will be unable to copy some files. This is usually due to inconsistent file permissions.' ), 'wp-admin/includes/update-core.php' );
   160 			return new WP_Error( 'copy_failed_for_update_core_file', __( 'The update cannot be installed because some files could not be copied. This is usually due to inconsistent file permissions.' ), 'wp-admin/includes/update-core.php' );
   161 		}
   161 		}
   162 		$wp_filesystem->chmod( $wp_dir . 'wp-admin/includes/update-core.php', FS_CHMOD_FILE );
   162 		$wp_filesystem->chmod( $wp_dir . 'wp-admin/includes/update-core.php', FS_CHMOD_FILE );
   163 
   163 
   164 		wp_opcache_invalidate( ABSPATH . 'wp-admin/includes/update-core.php' );
   164 		wp_opcache_invalidate( ABSPATH . 'wp-admin/includes/update-core.php' );
   165 		require_once ABSPATH . 'wp-admin/includes/update-core.php';
   165 		require_once ABSPATH . 'wp-admin/includes/update-core.php';