Ticket #4779: 4779.r8547.diff
File 4779.r8547.diff, 1.1 KB (added by , 15 years ago) |
---|
-
http.php
4 4 * 5 5 * Will eventually replace and standardize the WordPress HTTP requests made. 6 6 * 7 * @link http://trac.wordpress.org/ticket/4779 HTTP API Proposal 8 * 7 9 * @package WordPress 8 10 * @subpackage HTTP 9 11 * @since 2.7 … … 666 668 $context = stream_context_create($arrContext); 667 669 668 670 if ( !defined('WP_DEBUG') || ( defined('WP_DEBUG') && false === WP_DEBUG ) ) 669 $handle = @fopen($url, 'r' );671 $handle = @fopen($url, 'r', false, $context); 670 672 else 671 $handle = fopen($url, 'r' );673 $handle = fopen($url, 'r', false, $context); 672 674 673 675 if ( ! $handle) 674 676 return new WP_Error('http_request_failed', sprintf(__('Could not open handle for fopen() to %s'), $url)); … … 794 796 795 797 list($theHeaders, $theBody) = explode("\r\n\r\n", $strResponse, 2); 796 798 $theHeaders = WP_Http::processHeaders($theHeaders); 799 $theBody = http_chunked_decode($theBody); 797 800 798 801 $theResponse = array(); 799 802 $theResponse['code'] = $info['response_code'];