- Patch #6887 by drumm: fixed drupal_http_request

4.4.x
Dries Buytaert 2004-04-27 18:18:24 +00:00
parent 630ece975c
commit 83a92386ef
1 changed files with 3 additions and 1 deletions

View File

@ -333,12 +333,14 @@ function drupal_http_request($url, $headers = array(), $method = 'GET', $data =
fwrite($fp, $request);
// Fetch response.
$response = '';
while (!feof($fp) && $data = fread($fp, 1024)) {
$response[] = $data;
$response .= $data;
}
fclose($fp);
// Parse response.
$response = preg_split("/\r\n|\n|\r/", $response);
list($protocol, $code, $text) = explode(' ', trim(array_shift($response)), 3);
$result->headers = array();
$result->data = '';