From 292f387dd855d256f064369fa9b2dda793b5e64c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Mon, 14 Jan 2013 20:56:22 +0100 Subject: [PATCH] Improve ChatRoom::getUsers() --- file/lib/data/chat/room/ChatRoom.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/file/lib/data/chat/room/ChatRoom.class.php b/file/lib/data/chat/room/ChatRoom.class.php index ef189ef..de42c30 100644 --- a/file/lib/data/chat/room/ChatRoom.class.php +++ b/file/lib/data/chat/room/ChatRoom.class.php @@ -167,9 +167,9 @@ public function getUsers() { $stmt = WCF::getDB()->prepareStatement($sql); $stmt->execute(array('roomID', $this->roomID)); $userIDs = array(); - while ($userIDs[] = $stmt->fetchColumn()); + while ($userID = $stmt->fetchColumn()) $userIDs[] = $userID; - if (!count($userIDs)) return array(); + if (empty($userIDs)) return array(); $sql = "SELECT u.*,