Index: http.php
===================================================================
--- http.php	(revision 296)
+++ http.php	(working copy)
@@ -297,11 +297,18 @@
 
 		if ( has_action('http_api_debug') )
 			do_action('http_api_debug', $transports, 'transports_list');
-
 		$response = array( 'headers' => array(), 'body' => '', 'response' => array('code' => false, 'message' => false), 'cookies' => array() );
 		foreach ( (array) $transports as $transport ) {
 			$response = $transport->request($url, $r);
-
+			if (ini_get('open_basedir')) {
+				$r['redirection']--;
+				$url = $response['headers']['location'];
+				if ($r['redirection'] < 1 && $response['headers']['location']) $response = new WP_Error('http_request_failed',__('Too many redirects.'));
+				if ( ! is_wp_error($response) && !empty ($url)) {
+					$url = $response['headers']['location'];
+					$response = $this->request($url, array('redirection' => $r['redirection']));
+				}
+			}
 			if ( has_action('http_api_debug') )
 				do_action( 'http_api_debug', $response, 'response', get_class($transport) );
 
