diff --git a/src/API/Oauth2Client.php b/src/API/Oauth2Client.php index f753d27a..acf62d34 100644 --- a/src/API/Oauth2Client.php +++ b/src/API/Oauth2Client.php @@ -237,7 +237,11 @@ private function dontPersist($name) { * @return Boolean Whether it exchanged the code or not correctly */ public function exchangeCode() { - $code = isset($_GET['code']) ? $_GET['code'] : $_POST['code']; + + $code = isset($_GET['code']) + ? $_GET['code'] + : ( isset($_POST['code']) ? $_POST['code'] : null ); + if (!isset($code)) { $this->debugInfo("No code found in _GET or _POST params."); return false;