Skip to content

Commit

Permalink
Use parse_str in less evil way
Browse files Browse the repository at this point in the history
  • Loading branch information
adamwathan committed Feb 23, 2015
1 parent 8aee2c1 commit 250f576
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/AdamWathan/EloquentOAuth/Providers/FacebookProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@ protected function getUserDataUrl()

protected function parseTokenResponse($response)
{
parse_str($response);
if (! isset($access_token)) {
$params = [];
parse_str($response, $params);
if (! isset($params['access_token'])) {
throw new InvalidAuthorizationCodeException;
}
return $access_token;
return $params['access_token'];
}

protected function parseUserDataResponse($response)
Expand Down

0 comments on commit 250f576

Please sign in to comment.