From 0eb439e75f0e21f752f2b421f83ce7f96944ee18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Sat, 10 Dec 2011 17:20:57 +0100 Subject: [PATCH] Use fetchColumn to fetch the object-ids --- file/lib/data/chat/message/ChatMessageEditor.class.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/file/lib/data/chat/message/ChatMessageEditor.class.php b/file/lib/data/chat/message/ChatMessageEditor.class.php index 0e8a80f..b2f8a60 100644 --- a/file/lib/data/chat/message/ChatMessageEditor.class.php +++ b/file/lib/data/chat/message/ChatMessageEditor.class.php @@ -24,7 +24,7 @@ class ChatMessageEditor extends \wcf\data\DatabaseObjectEditor { * @return integer Number of deleted messages. */ public static function cleanup($lifetime = CHAT_ARCHIVETIME) { - $sql = "SELECT + $sql = "SELECT ".static::getDatabaseIndexName()." FROM ".static::getDatabaseTableName()." @@ -33,9 +33,7 @@ public static function cleanup($lifetime = CHAT_ARCHIVETIME) { $statement = \wcf\system\WCF::getDB()->prepareStatement($sql); $statement->execute(TIME_NOW - $lifetime); $objectIDs = array(); - while ($row = $statement->fetchArray()) { - $objectIDs[] = $row[static::getDatabaseIndexName()]; - } + while ($objectIDs[] = $statement->fetchColumn()); return static::deleteAll($objectIDs); } }