Do not attempt to parse empty email addresses
authorAlexander Ebert <ebert@woltlab.com>
Sun, 12 Nov 2023 14:31:34 +0000 (15:31 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Sun, 12 Nov 2023 14:31:34 +0000 (15:31 +0100)
See https://www.woltlab.com/community/thread/302317-fehlermeldung-bei-benutzern-ohne-e-mail/

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

index 98f40e23a251397ca9cad147f57728095345bb0f..31fc2cff35ffc70dc0d16bab5ef8918f9923463a 100644 (file)
@@ -1006,6 +1006,10 @@ class UserProfile extends DatabaseObjectDecorator implements ITitledLinkObject
      */
     public function getEncodedEmail(): string
     {
+        if ($this->email === '') {
+            return '';
+        }
+
         $mailbox = new Mailbox($this->email);
 
         return StringUtil::encodeAllChars($mailbox->getAddressForMailto());