Skip to content

Commit

Permalink
Merge pull request #1 from oat-sa/fix/nonapache-headers
Browse files Browse the repository at this point in the history
parse headers on non apache
  • Loading branch information
Jérôme Bogaerts committed Mar 23, 2015
2 parents 9dd0f3c + ff75a5a commit 558f482
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion core/Request.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,14 @@ public function __construct()
// apache
$this->headers = apache_request_headers();
} else {
// no headers on non apache
$this->headers = array();
foreach ($_SERVER as $name => $value)
{
if (substr($name, 0, 5) == 'HTTP_')
{
$this->headers[str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5)))))] = $value;
}
}
}

$this->files = $_FILES;
Expand Down

0 comments on commit 558f482

Please sign in to comment.