WordPress.org

Make WordPress Core

Ticket #13841: 13841.patch

File 13841.patch, 1.2 KB (added by hakre, 7 years ago)

Refreshed against trunk

  • wp-includes/class-http.php

    ### Eclipse Workspace Patch 1.0
    #P wordpress-trunk
     
    102102                        'filename' => null
    103103                );
    104104
    105                
    106105                // Pre-parse for the HEAD checks.
    107106                $args = wp_parse_args( $args );
    108107
     
    861860                if ( ! empty($r['body'] ) )
    862861                        $arrContext['http']['content'] = $r['body'];
    863862
     863                // timeouts with stream_contect_create for some reason need to be half of what you expect
     864                $arrContext['http']['timeout'] = $r['timeout'] / 2;
     865
    864866                $context = stream_context_create($arrContext);
    865867
    866868                if ( !WP_DEBUG )
     
    908910                else
    909911                        $processedHeaders = WP_Http::processHeaders($meta['wrapper_data']);
    910912
    911                 // Streams does not provide an error code which we can use to see why the request stream stoped. 
     913                // Streams does not provide an error code which we can use to see why the request stream stoped.
    912914                // We can however test to see if a location header is present and return based on that.
    913915                if ( isset($processedHeaders['headers']['location']) && 0 !== $args['_redirection'] )
    914916                        return new WP_Error('http_request_failed', __('Too many redirects.'));