3 Commits

Author SHA1 Message Date
Jacob Kiers
d2b3281815 Release 1.0.11
This release fixes a little bug in the exception that is thrown when an
invalid token is encountered.

Reported and fixed by @elieux.

Signed-off-by: Jacob Kiers <jacob@alphacomm.nl>
2015-07-16 16:06:29 +02:00
999a007b3b Merge pull request #6 from elieux/master-fix1
Fix variable name when creating an "invalid token" exception
2015-07-16 16:04:50 +02:00
David Macek
3ef8e25bdb Fix variable name when creating an "invalid token" exception 2015-07-16 15:53:27 +02:00
3 changed files with 3 additions and 9 deletions

View File

@@ -8,3 +8,4 @@ Andy Smith authored the original code (http://oauth.googlecode.com/svn/code/php/
* Jacob Kiers (@jacobkiers)
* Alexandru G. (@vimishor)
* Victor Bjelkholm (@VictorBjelkholm)
* David Macek (@elieux)

View File

@@ -93,17 +93,10 @@ public function __construct($http_method, $http_url, array $parameters = null)
public static function fromRequest($http_method = null, $http_url = null, $parameters = null)
{
$scheme = (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on') ? 'http' : 'https';
$scheme = isset($_SERVER['HTTP_X_FORWARDED_PROTO'])
? $_SERVER['HTTP_X_FORWARDED_PROTO']
: $scheme;
$port = isset($_SERVER['HTTP_X_FORWARDED_PORT'])
? $_SERVER['HTTP_X_FORWARDED_PORT']
: $_SERVER['SERVER_PORT'];
$http_url = ($http_url) ? $http_url : $scheme .
'://' . $_SERVER['HTTP_HOST'] .
':' .
$port .
$_SERVER['SERVER_PORT'] .
$_SERVER['REQUEST_URI'];
$http_method = ($http_method) ? $http_method : $_SERVER['REQUEST_METHOD'];

View File

@@ -243,7 +243,7 @@ private function getToken(RequestInterface $request, ConsumerInterface $consumer
$token = $this->data_store->lookupToken($consumer, $token_type, $token_key);
if (!$token) {
throw new OAuthException("Invalid $token_type token: $token_field");
throw new OAuthException("Invalid $token_type token: $token_key");
}
return $token;
}