Skip to content

Commit

Permalink
Look for code in _GET or _POST explicitly.
Browse files Browse the repository at this point in the history
This change is for those using frameworks or PHP configurations that strip out _REQUEST params.
  • Loading branch information
SeanZicari authored Dec 28, 2016
1 parent 561db79 commit dfd7e0a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/API/Oauth2Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,11 @@ private function dontPersist($name) {
* @return Boolean Whether it exchanged the code or not correctly
*/
public function exchangeCode() {
if (!isset($_REQUEST['code'])) {
$code = $_GET['code'] ?: $_POST['code'];
if (!isset($code)) {
$this->debugInfo("No code found in _GET or _POST params.");
return false;
}
$code = $_REQUEST['code'];

$this->debugInfo("Code: ".$code);

Expand Down

0 comments on commit dfd7e0a

Please sign in to comment.