Work-around for invalid email addresses
authorAlexander Ebert <ebert@woltlab.com>
Fri, 22 Dec 2023 15:06:57 +0000 (16:06 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Fri, 22 Dec 2023 15:06:57 +0000 (16:06 +0100)
See https://www.woltlab.com/community/thread/303187-fehler-bei-email-an-alle-nutzer/

wcfsetup/install/files/lib/data/user/UserProfile.class.php

index 31fc2cff35ffc70dc0d16bab5ef8918f9923463a..0739acf0f14e5ef42a3df003ec56f078e3c952f2 100644 (file)
@@ -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());
     }