Skip to content
This repository has been archived by the owner on Jul 24, 2023. It is now read-only.

Commit

Permalink
[project @ Handle malformed HTTP headers in fetchers]
Browse files Browse the repository at this point in the history
  • Loading branch information
tailor committed Mar 13, 2008
1 parent a927e85 commit 2370ac1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 6 additions & 2 deletions Auth/Yadis/ParanoidHTTPFetcher.php
Expand Up @@ -125,8 +125,12 @@ function get($url, $extra_headers = null)

foreach ($headers as $header) {
if (preg_match("/:/", $header)) {
list($name, $value) = explode(": ", $header, 2);
$new_headers[$name] = $value;
$parts = explode(": ", $header, 2);

if (count($parts) == 2) {
list($name, $value) = $parts;
$new_headers[$name] = $value;
}
}
}

Expand Down
8 changes: 6 additions & 2 deletions Auth/Yadis/PlainHTTPFetcher.php
Expand Up @@ -132,8 +132,12 @@ function get($url, $extra_headers = null)

foreach ($headers as $header) {
if (preg_match("/:/", $header)) {
list($name, $value) = explode(": ", $header, 2);
$new_headers[$name] = $value;
$parts = explode(": ", $header, 2);

if (count($parts) == 2) {
list($name, $value) = $parts;
$new_headers[$name] = $value;
}
}

}
Expand Down

0 comments on commit 2370ac1

Please sign in to comment.