summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--includes/common.inc4
1 files changed, 3 insertions, 1 deletions
diff --git a/includes/common.inc b/includes/common.inc
index 3eb76b48b..ca1976a32 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -914,7 +914,9 @@ function drupal_http_request($url, array $options = array()) {
return $result;
}
// Parse response headers from the response body.
- list($response, $result->data) = explode("\r\n\r\n", $response, 2);
+ // Be tolerant of malformed HTTP responses that separate header and body with
+ // \n\n or \r\r instead of \r\n\r\n.
+ list($response, $result->data) = preg_split("/\r\n\r\n|\n\n|\r\r/", $response, 2);
$response = preg_split("/\r\n|\n|\r/", $response);
// Parse the response status line.