From 087cb1278fbf6d92a94bc2f597e3437477ac9193 Mon Sep 17 00:00:00 2001 From: Alexandru G Date: Wed, 5 Jun 2013 13:37:45 +0300 Subject: [PATCH] Because `$token` refs an object, this statement will always be true. Therefore an empty `oauth_token` param will be added to each request, wich will break Bitbucket authorization process. To fix this, we need to check if token key is empty and ignore it. --- src/JacobKiers/OAuth/Request/Request.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/JacobKiers/OAuth/Request/Request.php b/src/JacobKiers/OAuth/Request/Request.php index bb4364f..b44ca78 100644 --- a/src/JacobKiers/OAuth/Request/Request.php +++ b/src/JacobKiers/OAuth/Request/Request.php @@ -157,7 +157,7 @@ class Request implements RequestInterface 'oauth_nonce' => Request::generateNonce(), 'oauth_timestamp' => Request::generateTimestamp(), 'oauth_consumer_key' => $consumer->getKey()); - if ($token) { + if ($token->getKey()) { $defaults['oauth_token'] = $token->getKey(); }