- Patch #6887 by drumm: fixed drupal_http_request
parent
a2da46a10a
commit
b3265bcb86
|
@ -373,12 +373,14 @@ function drupal_http_request($url, $headers = array(), $method = 'GET', $data =
|
||||||
fwrite($fp, $request);
|
fwrite($fp, $request);
|
||||||
|
|
||||||
// Fetch response.
|
// Fetch response.
|
||||||
|
$response = '';
|
||||||
while (!feof($fp) && $data = fread($fp, 1024)) {
|
while (!feof($fp) && $data = fread($fp, 1024)) {
|
||||||
$response[] = $data;
|
$response .= $data;
|
||||||
}
|
}
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
|
|
||||||
// Parse response.
|
// Parse response.
|
||||||
|
$response = preg_split("/\r\n|\n|\r/", $response);
|
||||||
list($protocol, $code, $text) = explode(' ', trim(array_shift($response)), 3);
|
list($protocol, $code, $text) = explode(' ', trim(array_shift($response)), 3);
|
||||||
$result->headers = array();
|
$result->headers = array();
|
||||||
$result->data = '';
|
$result->data = '';
|
||||||
|
|
Loading…
Reference in New Issue