Wrapped getallheaders() method in function_exists (function isn't available on command line)

This commit is contained in:
Alex Bilbie 2012-08-24 12:25:31 +01:00
parent 87ec05dba6
commit 465c1c6ab2

View File

@ -127,13 +127,15 @@ class Server
} }
// Try and get an access token from the auth header // Try and get an access token from the auth header
$headers = getallheaders(); if (function_exists('getallheaders')) {
if (isset($headers['Authorization'])) { $headers = getallheaders();
if (isset($headers['Authorization'])) {
$rawToken = trim(str_replace('Bearer', '', $headers['Authorization'])); $rawToken = trim(str_replace('Bearer', '', $headers['Authorization']));
if ( ! empty($rawToken)) if ( ! empty($rawToken))
{ {
$accessToken = base64_decode($rawToken); $accessToken = base64_decode($rawToken);
}
} }
} }