Use `->prepare()` instead if `->prepareStatement()` in ConversationEditor::removePart...
authorTim Düsterhus <duesterhus@woltlab.com>
Thu, 10 Feb 2022 10:49:41 +0000 (11:49 +0100)
committerTim Düsterhus <duesterhus@woltlab.com>
Thu, 10 Feb 2022 10:49:41 +0000 (11:49 +0100)
files/lib/data/conversation/ConversationEditor.class.php

index c337fc9dd20f399269845ffc77333a6c4fd71b4f..1c98e7806032ca7f80071cec2095403362f07750 100644 (file)
@@ -171,20 +171,20 @@ class ConversationEditor extends DatabaseObjectEditor
     public function removeParticipant($userID)
     {
         $sql = "SELECT  joinedAt
-                FROM    wcf" . WCF_N . "_conversation_to_user
+                FROM    wcf1_conversation_to_user
                 WHERE   conversationID = ?
                     AND participantID = ?";
-        $statement = WCF::getDB()->prepareStatement($sql, 1);
+        $statement = WCF::getDB()->prepare($sql, 1);
         $statement->execute([$this->conversationID, $userID]);
         $joinedAt = $statement->fetchSingleColumn();
 
         $sql = "SELECT      messageID
-                FROM        wcf" . WCF_N . "_conversation_message
+                FROM        wcf1_conversation_message
                 WHERE       conversationID = ?
                         AND time >= ?
                         AND time <= ?
                 ORDER BY    time DESC";
-        $statement = WCF::getDB()->prepareStatement($sql, 1);
+        $statement = WCF::getDB()->prepare($sql, 1);
         $statement->execute([
             $this->conversationID,
             $joinedAt,
@@ -192,13 +192,13 @@ class ConversationEditor extends DatabaseObjectEditor
         ]);
         $lastMessageID = $statement->fetchSingleColumn();
 
-        $sql = "UPDATE  wcf" . WCF_N . "_conversation_to_user
+        $sql = "UPDATE  wcf1_conversation_to_user
                 SET     leftAt = ?,
                         lastMessageID = ?,
                         leftByOwnChoice = ?
                 WHERE   conversationID = ?
                     AND participantID = ?";
-        $statement = WCF::getDB()->prepareStatement($sql);
+        $statement = WCF::getDB()->prepare($sql);
         $statement->execute([
             TIME_NOW,
             $lastMessageID ?: null,