From 1382bdca4556e70e800d890a2c3f5ae47074a212 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Fri, 22 Dec 2023 16:06:57 +0100 Subject: [PATCH] Work-around for invalid email addresses See https://www.woltlab.com/community/thread/303187-fehler-bei-email-an-alle-nutzer/ --- wcfsetup/install/files/lib/data/user/UserProfile.class.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/wcfsetup/install/files/lib/data/user/UserProfile.class.php b/wcfsetup/install/files/lib/data/user/UserProfile.class.php index 31fc2cff35..0739acf0f1 100644 --- a/wcfsetup/install/files/lib/data/user/UserProfile.class.php +++ b/wcfsetup/install/files/lib/data/user/UserProfile.class.php @@ -1010,7 +1010,12 @@ class UserProfile extends DatabaseObjectDecorator implements ITitledLinkObject return ''; } - $mailbox = new Mailbox($this->email); + try { + $mailbox = new Mailbox($this->email); + } catch (\Throwable) { + // Skip invalid email addresses. + return ''; + } return StringUtil::encodeAllChars($mailbox->getAddressForMailto()); } -- 2.20.1