Compare commits
3 Commits
brutuscat/
...
1.0.11
Author | SHA1 | Date | |
---|---|---|---|
![]() |
d2b3281815 | ||
999a007b3b | |||
![]() |
3ef8e25bdb |
@@ -8,3 +8,4 @@ Andy Smith authored the original code (http://oauth.googlecode.com/svn/code/php/
|
|||||||
* Jacob Kiers (@jacobkiers)
|
* Jacob Kiers (@jacobkiers)
|
||||||
* Alexandru G. (@vimishor)
|
* Alexandru G. (@vimishor)
|
||||||
* Victor Bjelkholm (@VictorBjelkholm)
|
* Victor Bjelkholm (@VictorBjelkholm)
|
||||||
|
* David Macek (@elieux)
|
||||||
|
@@ -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)
|
public static function fromRequest($http_method = null, $http_url = null, $parameters = null)
|
||||||
{
|
{
|
||||||
$scheme = (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on') ? 'http' : 'https';
|
$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 .
|
$http_url = ($http_url) ? $http_url : $scheme .
|
||||||
'://' . $_SERVER['HTTP_HOST'] .
|
'://' . $_SERVER['HTTP_HOST'] .
|
||||||
':' .
|
':' .
|
||||||
$port .
|
$_SERVER['SERVER_PORT'] .
|
||||||
$_SERVER['REQUEST_URI'];
|
$_SERVER['REQUEST_URI'];
|
||||||
$http_method = ($http_method) ? $http_method : $_SERVER['REQUEST_METHOD'];
|
$http_method = ($http_method) ? $http_method : $_SERVER['REQUEST_METHOD'];
|
||||||
|
|
||||||
|
@@ -243,7 +243,7 @@ private function getToken(RequestInterface $request, ConsumerInterface $consumer
|
|||||||
|
|
||||||
$token = $this->data_store->lookupToken($consumer, $token_type, $token_key);
|
$token = $this->data_store->lookupToken($consumer, $token_type, $token_key);
|
||||||
if (!$token) {
|
if (!$token) {
|
||||||
throw new OAuthException("Invalid $token_type token: $token_field");
|
throw new OAuthException("Invalid $token_type token: $token_key");
|
||||||
}
|
}
|
||||||
return $token;
|
return $token;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user