From c4af41481afd3b2ec8563ddafb3ed7f6a469f567 Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Thu, 14 Jun 2018 18:29:58 +0200 Subject: [PATCH] made sure that __toString() always returns a string --- wcfsetup/install/files/lib/data/user/User.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wcfsetup/install/files/lib/data/user/User.class.php b/wcfsetup/install/files/lib/data/user/User.class.php index a4546e02b3..c92b89809b 100644 --- a/wcfsetup/install/files/lib/data/user/User.class.php +++ b/wcfsetup/install/files/lib/data/user/User.class.php @@ -421,7 +421,7 @@ final class User extends DatabaseObject implements IRouteController, IUserConten * @return string */ public function __toString() { - return $this->username; + return ($this->username ?: ''); } /** -- 2.20.1