Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
721b9a1b
Commit
721b9a1b
authored
Apr 23, 2011
by
Dries Buytaert
Browse files
- Patch
#183435
by gregmac, TR: drupal_http_request() and malformed responses.
parent
3007a494
Changes
1
Hide whitespace changes
Inline
Side-by-side
includes/common.inc
View file @
721b9a1b
...
...
@@ -915,7 +915,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.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment