From 914cc3bd924f3cb6c63ae5c245be7488bf24289a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fl=C3=A1vio=20Heleno?= Date: Thu, 26 Nov 2015 11:31:12 -0200 Subject: [PATCH] Proper API Version handling for FB's URLs --- src/OAuth/OAuth2/Service/Facebook.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/OAuth/OAuth2/Service/Facebook.php b/src/OAuth/OAuth2/Service/Facebook.php index 308513bc..9ba610e3 100644 --- a/src/OAuth/OAuth2/Service/Facebook.php +++ b/src/OAuth/OAuth2/Service/Facebook.php @@ -169,7 +169,7 @@ protected function parseAccessTokenResponse($responseBody) $token = new StdOAuth2Token(); $token->setAccessToken($data['access_token']); - + if (isset($data['expires'])) { $token->setLifeTime($data['expires']); } @@ -198,6 +198,14 @@ public function getDialogUri($dialogPath, array $parameters) return new Uri($baseUrl . '?' . $query); } + /** + * {@inheritdoc} + */ + protected function getApiVersionString() + { + return empty($this->apiVersion) ? '' : '/v' . $this->apiVersion; + } + /** * {@inheritdoc} */