Skip to content
This repository has been archived by the owner on Oct 6, 2020. It is now read-only.

Adding forced parameter seperator on http_build_query #23

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.idea
19 changes: 16 additions & 3 deletions src/OAuth2/Provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,21 @@ public function access($code, $options = array())
{
case 'GET':
// Need to switch to Request library, but need to test it on one that works
$url .= '?'.http_build_query($params);
$response = file_get_contents($url);
$url .= '?'.http_build_query($params, '', '&');

// make request
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);

// handle error; error output
if(curl_getinfo($ch, CURLINFO_HTTP_CODE) !== 200) {
curl_error($ch);
Throw new \Exception('Something went wrong with oAuth2 Provider: ' . $response);
}

curl_close($ch);

parse_str($response, $return);
break;
Expand Down Expand Up @@ -239,4 +252,4 @@ public function access($code, $options = array())

}

}
}