From 3eaf35c9c10758bcb4fee143881aec0e9766f530 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Wed, 18 Apr 2012 22:45:11 +0200 Subject: [PATCH] ChatUtil::writeUserData now accepts the user-object as the second parameter. --- file/lib/util/ChatUtil.class.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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); } }