Fix FacebookAuthAction
authorTim Düsterhus <duesterhus@woltlab.com>
Wed, 29 Mar 2017 12:01:32 +0000 (14:01 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Wed, 29 Mar 2017 12:01:32 +0000 (14:01 +0200)
wcfsetup/install/files/lib/action/FacebookAuthAction.class.php

index 545e08757a020de4e33c7226d87d8c050e00043f..da1deecd25ad9660d758ec2c9ed3bdc73d2bba98 100644 (file)
@@ -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