Changeset 45262 for trunk/src/wp-admin/includes/class-wp-upgrader.php
- Timestamp:
- 04/24/2019 07:43:29 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-upgrader.php
r44954 r45262 245 245 * @since 2.8.0 246 246 * 247 * @param string $package The URI of the package. If this is the full path to an 248 * existing local file, it will be returned untouched. 247 * @param string $package The URI of the package. If this is the full path to an 248 * existing local file, it will be returned untouched. 249 * @param bool $check_signatures Whether to validate file signatures. Default false. 249 250 * @return string|WP_Error The full path to the downloaded package file, or a WP_Error object. 250 251 */ 251 public function download_package( $package ) {252 public function download_package( $package, $check_signatures = false ) { 252 253 253 254 /** … … 276 277 $this->skin->feedback( 'downloading_package', $package ); 277 278 278 $download_file = download_url( $package, 300, true);279 $download_file = download_url( $package, 300, $check_signatures ); 279 280 280 281 if ( is_wp_error( $download_file ) && ! $download_file->get_error_data( 'softfail-filename' ) ) { … … 731 732 * of the file if the package is a local file) 732 733 */ 733 $download = $this->download_package( $options['package'] );734 $download = $this->download_package( $options['package'], true ); 734 735 735 736 // Allow for signature soft-fail. 736 737 // WARNING: This may be removed in the future. 737 738 if ( is_wp_error( $download ) && $download->get_error_data( 'softfail-filename' ) ) { 738 // Outout the failure error as a normal feedback, and not as an error: 739 $this->skin->feedback( $download->get_error_message() ); 740 741 // Report this failure back to WordPress.org for debugging purposes. 742 wp_version_check( 743 array( 744 'signature_failure_code' => $download->get_error_code(), 745 'signature_failure_data' => $download->get_error_data(), 746 ) 747 ); 739 740 // Don't output the 'no signature could be found' failure message for now. 741 if ( 'signature_verification_no_signature' != $download->get_error_code() || WP_DEBUG ) { 742 // Outout the failure error as a normal feedback, and not as an error: 743 $this->skin->feedback( $download->get_error_message() ); 744 745 // Report this failure back to WordPress.org for debugging purposes. 746 wp_version_check( 747 array( 748 'signature_failure_code' => $download->get_error_code(), 749 'signature_failure_data' => $download->get_error_data(), 750 ) 751 ); 752 } 748 753 749 754 // Pretend this error didn't happen.
Note: See TracChangeset
for help on using the changeset viewer.