WordPress.org

Make WordPress Core

Ticket #39309: 39309-single-header.diff

File 39309-single-header.diff, 949 bytes (added by dd32, 7 months ago)
  • src/wp-admin/includes/file.php

    diff --git a/src/wp-admin/includes/file.php b/src/wp-admin/includes/file.php
    index 11e5f9231f..f6f8da63b4 100644
    a b function download_url( $url, $timeout = 300, $signature_softfail = true ) { 
    10501050        // Perform the valiation
    10511051        if ( $signature_verification ) {
    10521052                $signature = wp_remote_retrieve_header( $response, 'x-content-signature' );
    1053                 if ( ! $signature ) {
     1053                if ( $signature ) {
     1054                        // WP_HTTP will return multiple headers as an array.
     1055                        // But a proxy may combine the multiple headers into a single header separated by ', '.
     1056                        if ( is_string( $signature ) ) {
     1057                                $signature = preg_split( '/[,\s]/', $signature, 0, PREG_SPLIT_NO_EMPTY );
     1058                        }
     1059                } else {
    10541060                        // Retrieve signatures from a file if the header wasn't included.
    10551061                        // WordPress.org stores signatures at $package_url.sig
    10561062                        $signature_request = wp_safe_remote_get( $url . '.sig' );