From 834f639f2ccbe17fbed7bc7a9ea031c683566573 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Wed, 29 Mar 2017 14:01:32 +0200 Subject: [PATCH] Fix FacebookAuthAction --- .../files/lib/action/FacebookAuthAction.class.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/wcfsetup/install/files/lib/action/FacebookAuthAction.class.php b/wcfsetup/install/files/lib/action/FacebookAuthAction.class.php index 545e08757a..da1deecd25 100644 --- a/wcfsetup/install/files/lib/action/FacebookAuthAction.class.php +++ b/wcfsetup/install/files/lib/action/FacebookAuthAction.class.php @@ -56,7 +56,14 @@ class FacebookAuthAction extends AbstractAction { if (!isset($_GET['state']) || $_GET['state'] != WCF::getSession()->getVar('__facebookInit')) throw new IllegalLinkException(); WCF::getSession()->unregister('__facebookInit'); - parse_str($content, $data); + try { + $data = JSON::decode($content); + } + catch (SystemException $e) { + parse_str($content, $data); + } + + if (!isset($data['access_token'])) throw new IllegalLinkException(); try { // fetch userdata -- 2.20.1