Fix empty issue in PHP 5.4

This commit is contained in:
sephster 2018-06-22 13:47:22 +01:00
parent 3bec591393
commit 8335935854
No known key found for this signature in database
GPG Key ID: 077754CA23023F4F

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')