Ticket #8476: 8476.3.diff
File 8476.3.diff, 1.6 KB (added by , 16 years ago) |
---|
-
http.php
672 672 if ( function_exists('stream_get_meta_data') ) { 673 673 $meta = stream_get_meta_data($handle); 674 674 $theHeaders = $meta['wrapper_data']; 675 if( isset( $meta['wrapper_data']['headers'] ) ) 676 $theHeaders = $meta['wrapper_data']['headers']; 677 var_dump($theHeaders); 675 678 } else { 679 if( ! isset( $http_response_header ) ) 680 global $http_response_header; 676 681 $theHeaders = $http_response_header; 677 682 } 678 683 … … 793 798 794 799 $strResponse = stream_get_contents($handle); 795 800 $meta = stream_get_meta_data($handle); 796 $processedHeaders = WP_Http::processHeaders($meta['wrapper_data']);797 801 802 $processedHeaders = array(); 803 if( isset( $meta['wrapper_data']['headers'] ) ) 804 $processedHeaders = WP_Http::processHeaders($meta['wrapper_data']['headers']); 805 else 806 $processedHeaders = WP_Http::processHeaders($meta['wrapper_data']); 807 var_dump($processedHeaders); 808 798 809 if ( ! empty( $strResponse ) && isset( $processedHeaders['headers']['transfer-encoding'] ) && 'chunked' == $processedHeaders['headers']['transfer-encoding'] ) 799 810 $strResponse = WP_Http::chunkTransferDecode($strResponse); 800 811 … … 1031 1042 return new WP_Error('http_request_failed', $curl_error); 1032 1043 if ( in_array( curl_getinfo( $handle, CURLINFO_HTTP_CODE ), array(301, 302) ) ) 1033 1044 return new WP_Error('http_request_failed', __('Too many redirects.')); 1034 1045 1035 1046 $theHeaders = array( 'headers' => array() ); 1036 1047 $theBody = ''; 1037 1048 }