diff --git a/file/lib/util/ChatUtil.class.php b/file/lib/util/ChatUtil.class.php index f7d37e9..0188afd 100644 --- a/file/lib/util/ChatUtil.class.php +++ b/file/lib/util/ChatUtil.class.php @@ -223,14 +223,16 @@ public static function timeModifier($time) { /** * Writes user data * + * @param \wcf\data\user\User $user * @param array $data */ - public static function writeUserData(array $data) { + public static function writeUserData(array $data, \wcf\data\user\User $user = null) { + if ($user === null) $user = WCF::getUser(); $ush = UserStorageHandler::getInstance(); $packageID = self::getPackageID(); foreach($data as $key => $value) { - $ush->update(WCF::getUser()->userID, $key, (isset(static::$serialize[$key])) ? serialize($value) : $value, $packageID); + $ush->update($user->userID, $key, (isset(static::$serialize[$key])) ? serialize($value) : $value, $packageID); } }