Ticket #11305: http.php.diff
| File http.php.diff, 1.1 KB (added by calin, 4 years ago) |
|---|
-
http.php
297 297 298 298 if ( has_action('http_api_debug') ) 299 299 do_action('http_api_debug', $transports, 'transports_list'); 300 301 300 $response = array( 'headers' => array(), 'body' => '', 'response' => array('code' => false, 'message' => false), 'cookies' => array() ); 302 301 foreach ( (array) $transports as $transport ) { 303 302 $response = $transport->request($url, $r); 304 303 if (ini_get('open_basedir')) { 304 $r['redirection']--; 305 $url = $response['headers']['location']; 306 if ($r['redirection'] < 1 && $response['headers']['location']) $response = new WP_Error('http_request_failed',__('Too many redirects.')); 307 if ( ! is_wp_error($response) && !empty ($url)) { 308 $url = $response['headers']['location']; 309 $response = $this->request($url, array('redirection' => $r['redirection'])); 310 } 311 } 305 312 if ( has_action('http_api_debug') ) 306 313 do_action( 'http_api_debug', $response, 'response', get_class($transport) ); 307 314