From dfd7e0a7a6cb8e7ea21d3bee47fc6fa4f0ce0231 Mon Sep 17 00:00:00 2001 From: Sean Zicari Date: Wed, 28 Dec 2016 11:04:36 -0600 Subject: [PATCH] Look for code in _GET or _POST explicitly. This change is for those using frameworks or PHP configurations that strip out _REQUEST params. --- src/API/Oauth2Client.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/API/Oauth2Client.php b/src/API/Oauth2Client.php index 14cbd7c9..04f5d067 100644 --- a/src/API/Oauth2Client.php +++ b/src/API/Oauth2Client.php @@ -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);