Commit 83a92386 authored by Dries's avatar Dries

- Patch #6887 by drumm: fixed drupal_http_request

parent 630ece97
......@@ -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 = '';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment