Index: includes/common.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/common.inc,v retrieving revision 1.746 diff -u -p -r1.746 common.inc --- includes/common.inc 22 Dec 2007 23:24:24 -0000 1.746 +++ includes/common.inc 3 Jan 2008 16:12:40 -0000 @@ -508,7 +508,15 @@ function drupal_http_request($url, $head list($split, $result->data) = explode("\r\n\r\n", $response, 2); $split = preg_split("/\r\n|\n|\r/", $split); - list($protocol, $code, $text) = explode(' ', trim(array_shift($split)), 3); + // If the response does not include a description, don't try to process it. + // The test length of 13 includes the protocol, a space, the response code + // and one additional space, e.g., "HTTP/1.1 200 " + if (strlen($split[0]) > 13) { + list($protocol, $code, $text) = explode(' ', trim(array_shift($split)), 3); + } + else { + list($protocol, $code) = explode(' ', trim(array_shift($split)), 2); + } $result->headers = array(); // Parse headers.