From b1b31d7992934f29fa3eaf3f1f84090390d72577 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Wed, 30 Jun 2021 12:57:11 +0200 Subject: [PATCH] Handle Facebook not providing an email address Fixes #4241 --- .../install/files/lib/action/FacebookAuthAction.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wcfsetup/install/files/lib/action/FacebookAuthAction.class.php b/wcfsetup/install/files/lib/action/FacebookAuthAction.class.php index 901a855584..c5276b3846 100644 --- a/wcfsetup/install/files/lib/action/FacebookAuthAction.class.php +++ b/wcfsetup/install/files/lib/action/FacebookAuthAction.class.php @@ -106,7 +106,9 @@ final class FacebookAuthAction extends AbstractOauth2Action $parsed['__id'] = $parsed['id']; $parsed['__username'] = $parsed['name']; - $parsed['__email'] = $parsed['email']; + if (!empty($parsed['email'])) { + $parsed['__email'] = $parsed['email']; + } $parsed['accessToken'] = $accessToken; return new OauthUser($parsed); -- 2.20.1