Merge pull request #918 from Sephster/fix-914

Fix empty issue in PHP 5.4
This commit is contained in:
Andrew Millington 2018-06-23 17:27:31 +01:00 committed by GitHub
commit 138524984a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -138,7 +138,9 @@ class ResourceServer extends AbstractServer
*/ */
public function determineAccessToken($headerOnly = false) public function determineAccessToken($headerOnly = false)
{ {
if (!empty($this->getRequest()->headers->get('Authorization'))) { $authHeader = $this->getRequest()->headers->get('Authorization');
if (!empty($authHeader)) {
$accessToken = $this->getTokenType()->determineAccessTokenInHeader($this->getRequest()); $accessToken = $this->getTokenType()->determineAccessTokenInHeader($this->getRequest());
} elseif ($headerOnly === false && (! $this->getTokenType() instanceof MAC)) { } elseif ($headerOnly === false && (! $this->getTokenType() instanceof MAC)) {
$accessToken = ($this->getRequest()->server->get('REQUEST_METHOD') === 'GET') $accessToken = ($this->getRequest()->server->get('REQUEST_METHOD') === 'GET')