diff --git src/wp-admin/includes/class-core-upgrader.php src/wp-admin/includes/class-core-upgrader.php
index 5cb818cd59..c4c92f8da6 100644
|
|
|
class Core_Upgrader extends WP_Upgrader { |
| 119 | 119 | $to_download = 'full'; |
| 120 | 120 | } |
| 121 | 121 | |
| | 122 | // Allow custom modification of the package URL. |
| | 123 | $package_url = apply_filters( 'custom_update_package', $current->packages->$to_download, $to_download, $current ); |
| | 124 | |
| | 125 | // Determine if signature check is needed for the resolved package_url. |
| | 126 | // Defaults to true (perform signature check). Filter to return false to skip. |
| | 127 | $check_signatures = apply_filters( 'check_signature_for_package', true, $package_url, $to_download, $current ); |
| | 128 | |
| 122 | 129 | // Lock to prevent multiple Core Updates occurring. |
| 123 | 130 | $lock = WP_Upgrader::create_lock( 'core_updater', 15 * MINUTE_IN_SECONDS ); |
| 124 | 131 | if ( ! $lock ) { |
| 125 | 132 | return new WP_Error( 'locked', $this->strings['locked'] ); |
| 126 | 133 | } |
| 127 | 134 | |
| 128 | | $download = $this->download_package( $current->packages->$to_download, false ); |
| | 135 | $download = $this->download_package( $package_url, false, null, $check_signatures ); |
| 129 | 136 | |
| 130 | 137 | /* |
| 131 | 138 | * Allow for signature soft-fail. |
| … |
… |
class Core_Upgrader extends WP_Upgrader { |
| 277 | 284 | * @return bool True if we should update to the offered version, otherwise false. |
| 278 | 285 | */ |
| 279 | 286 | public static function should_update_to_version( $offered_ver ) { |
| 280 | | require ABSPATH . WPINC . '/version.php'; // $wp_version; // x.y.z |
| | 287 | require ABSPATH . WPINC . '/version.php'; // $wp_version; |
| 281 | 288 | |
| 282 | 289 | $current_branch = implode( '.', array_slice( preg_split( '/[.-]/', $wp_version ), 0, 2 ) ); // x.y |
| 283 | 290 | $new_branch = implode( '.', array_slice( preg_split( '/[.-]/', $offered_ver ), 0, 2 ) ); // x.y |
| … |
… |
class Core_Upgrader extends WP_Upgrader { |
| 403 | 410 | public function check_files() { |
| 404 | 411 | global $wp_version, $wp_local_package; |
| 405 | 412 | |
| | 413 | // Allow skipping checksums for custom packages. |
| | 414 | // Defaults to true (perform checksum check). Filter to return false to skip. |
| | 415 | if ( ! apply_filters( 'pre_check_md5_for_custom_package', true, $wp_version, isset( $wp_local_package ) ? $wp_local_package : 'en_US' ) ) { |
| | 416 | return true; // Pretend checksums are fine if filter returns false. |
| | 417 | } |
| | 418 | |
| 406 | 419 | $checksums = get_core_checksums( $wp_version, isset( $wp_local_package ) ? $wp_local_package : 'en_US' ); |
| 407 | 420 | |
| 408 | 421 | if ( ! is_array( $checksums ) ) { |
diff --git src/wp-admin/includes/class-wp-upgrader.php src/wp-admin/includes/class-wp-upgrader.php
index d641d10386..bfb6d1bf5e 100644
|
|
|
class WP_Upgrader { |
| 302 | 302 | * existing local file, it will be returned untouched. |
| 303 | 303 | * @param bool $check_signatures Whether to validate file signatures. Default false. |
| 304 | 304 | * @param array $hook_extra Extra arguments to pass to the filter hooks. Default empty array. |
| | 305 | * @param bool $force_check_signatures Whether to force signature check. Default null. |
| 305 | 306 | * @return string|WP_Error The full path to the downloaded package file, or a WP_Error object. |
| 306 | 307 | */ |
| 307 | | public function download_package( $package, $check_signatures = false, $hook_extra = array() ) { |
| | 308 | public function download_package( $package, $check_signatures = false, $hook_extra = array(), $force_check_signatures = null ) { |
| 308 | 309 | /** |
| 309 | 310 | * Filters whether to return the package. |
| 310 | 311 | * |
| … |
… |
class WP_Upgrader { |
| 332 | 333 | |
| 333 | 334 | $this->skin->feedback( 'downloading_package', $package ); |
| 334 | 335 | |
| 335 | | $download_file = download_url( $package, 300, $check_signatures ); |
| | 336 | // Use $force_check_signatures if passed and is_bool, otherwise use $check_signatures |
| | 337 | $perform_signature_check = is_bool( $force_check_signatures ) ? $force_check_signatures : $check_signatures; |
| | 338 | $download_file = download_url( $package, 300, $perform_signature_check ); |
| 336 | 339 | |
| 337 | 340 | if ( is_wp_error( $download_file ) && ! $download_file->get_error_data( 'softfail-filename' ) ) { |
| 338 | 341 | return new WP_Error( 'download_failed', $this->strings['download_failed'], $download_file->get_error_message() ); |