From d02f46240abddf1d0f4f667e1aab78d7737c4eff Mon Sep 17 00:00:00 2001 From: German Lena Date: Fri, 30 Dec 2016 18:39:54 -0300 Subject: [PATCH] fix fetch code --- src/API/Oauth2Client.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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;