diff --git a/file/lib/data/chat/message/ChatMessageEditor.class.php b/file/lib/data/chat/message/ChatMessageEditor.class.php index 8d5f1a1..53c10fd 100644 --- a/file/lib/data/chat/message/ChatMessageEditor.class.php +++ b/file/lib/data/chat/message/ChatMessageEditor.class.php @@ -24,11 +24,10 @@ class ChatMessageEditor extends \wcf\data\DatabaseObjectEditor { * @return integer Number of deleted messages. */ public static function prune($lifetime = CHAT_LOG_ARCHIVETIME) { - $baseClass = self::$baseClass; $sql = "SELECT - ".$baseClass::getDatabaseTableIndexName()." + ".static::getDatabaseTableIndexName()." FROM - ".$baseClass::getDatabaseTableName()." + ".static::getDatabaseTableName()." WHERE time < ?"; $stmt = \wcf\system\WCF::getDB()->prepareStatement($sql); diff --git a/file/lib/data/chat/room/ChatRoomEditor.class.php b/file/lib/data/chat/room/ChatRoomEditor.class.php index 5cc9146..8a1498a 100644 --- a/file/lib/data/chat/room/ChatRoomEditor.class.php +++ b/file/lib/data/chat/room/ChatRoomEditor.class.php @@ -41,21 +41,22 @@ public static function deleteAll(array $objectIDs = array()) { * @return integer Number of deleted rooms */ public static function prune() { - $baseClass = self::$baseClass; $sql = "SELECT - ".$baseClass::getDatabaseTableIndexName()." + ".static::getDatabaseTableIndexName()." FROM - ".$baseClass::getDatabaseTableName()." + ".static::getDatabaseTableName()." WHERE - permanent = ? - AND roomID NOT IN( + permanent = ? + AND roomID NOT IN ( SELECT fieldValue AS roomID FROM wcf".WCF_N."_user_storage WHERE packageID = ? - AND field = ?)"; + AND field = ? + AND fieldValue IS NOT NULL + )"; $stmt = \wcf\system\WCF::getDB()->prepareStatement($sql); $stmt->execute(array(0, \wcf\util\ChatUtil::getPackageID(), 'roomID')); $objectIDs = array();