From: Tim Düsterhus Date: Mon, 16 Mar 2015 17:07:57 +0000 (+0100) Subject: Work around Facebook not reading the URI RFC X-Git-Tag: 2.1.2~43 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=91fa38f0560d8a37d62bff711f88f8c98c9ad367;p=GitHub%2FWoltLab%2FWCF.git Work around Facebook not reading the URI RFC --- diff --git a/wcfsetup/install/files/lib/action/FacebookAuthAction.class.php b/wcfsetup/install/files/lib/action/FacebookAuthAction.class.php index 8f66cc8793..bec9de7e3f 100644 --- a/wcfsetup/install/files/lib/action/FacebookAuthAction.class.php +++ b/wcfsetup/install/files/lib/action/FacebookAuthAction.class.php @@ -36,6 +36,13 @@ class FacebookAuthAction extends AbstractAction { parent::execute(); $callbackURL = LinkHandler::getInstance()->getLink('FacebookAuth'); + + // Work around Facebook performing an illegal substitution of the Slash + // by '%2F' when entering redirect URI (RFC 3986 sect. 2.2, sect. 3.4) + $callbackURL = preg_replace_callback('/(?<=\?).*/', function ($matches) { + return rawurlencode($matches[0]); + }, $callbackURL); + // user accepted the connection if (isset($_GET['code'])) { try {