summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2011-04-23 16:34:22 -0400
committerDries Buytaert <dries@buytaert.net>2011-04-23 16:34:22 -0400
commit9f9e9c382479405f36c37a5448a2a5d4a4fcc6c9 (patch)
tree493de7f607b2b99a453c6957a656cc515e2fc475 /includes
parent05e249e8f85c1673e591401ae7a8c6f26f80e95d (diff)
downloadbrdo-9f9e9c382479405f36c37a5448a2a5d4a4fcc6c9.tar.gz
brdo-9f9e9c382479405f36c37a5448a2a5d4a4fcc6c9.tar.bz2
- Patch #183435 by gregmac, TR: drupal_http_request() and malformed responses.
Diffstat (limited to 'includes')
-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.