Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle apache_request_headers() non-array return values #57

Merged
merged 1 commit into from Mar 5, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 7 additions & 4 deletions lib/OAuth2/OAuth2.php
Expand Up @@ -589,11 +589,14 @@ protected function getBearerTokenFromHeaders(Request $request, $removeFromReques
if (function_exists('apache_request_headers')) {
$headers = apache_request_headers();

// Server-side fix for bug in old Android versions (a nice side-effect of this fix means we don't care about capitalization for Authorization)
$headers = array_combine(array_map('ucwords', array_keys($headers)), array_values($headers));
if (is_array($headers)) {

if (isset($headers['Authorization'])) {
$header = $headers['Authorization'];
// Server-side fix for bug in old Android versions (a nice side-effect of this fix means we don't care about capitalization for Authorization)
$headers = array_combine(array_map('ucwords', array_keys($headers)), array_values($headers));

if (isset($headers['Authorization'])) {
$header = $headers['Authorization'];
}
}
}
} else {
Expand Down