Fix error caused by undefined username
authorMarcel Werk <burntime@woltlab.com>
Thu, 4 Jan 2024 13:44:29 +0000 (14:44 +0100)
committerMarcel Werk <burntime@woltlab.com>
Thu, 4 Jan 2024 13:44:29 +0000 (14:44 +0100)
wcfsetup/install/files/lib/data/user/User.class.php

index 04972aca9f8c32333e7daa145af303233ecc78ef..0b77456a76d6610cd47b5cf4f409f1ed2dc6be00 100644 (file)
@@ -488,7 +488,7 @@ final class User extends DatabaseObject implements IPopoverObject, IRouteControl
      */
     public function __toString(): string
     {
-        return $this->username ?: '';
+        return $this->getTitle();
     }
 
     /**
@@ -504,7 +504,7 @@ final class User extends DatabaseObject implements IPopoverObject, IRouteControl
      */
     public function getTitle(): string
     {
-        return $this->username;
+        return $this->username ?: '';
     }
 
     /**