PluginProbe
wpForo Forum / 3.1.6
wpForo Forum v3.1.6
3.1.6 3.1.5 3.1.4 3.1.2 3.1.1 3.1.0 3.0.9 3.0.8 3.0.7 trunk 1.0.0 1.0.1 1.0.2 1.1.0 1.1.1 1.1.2 1.2.0 1.3.0 1.3.1 1.4.0 1.4.1 1.4.10 1.4.11 1.4.12 1.4.13 All 138 releases
← All changes | classes/AIChatbot.php +8 -1 3.1.03.1.6 View file →
@@ -204,9 +204,16 @@
204 204 */
205 205 public function delete_conversation( $conversation_id ) {
206 206 $userid = WPF()->current_userid;
207 207
208 - // Delete messages first
208 + // SECURITY: Verify ownership before deleting anything
209 + // get_conversation() returns null if conversation doesn't belong to current user
210 + $conversation = $this->get_conversation( $conversation_id );
211 + if ( ! $conversation ) {
212 + return false;
213 + }
214 +
215 + // Delete messages first (now safe - ownership verified above)
209 216 $messages_table = WPF()->tables->ai_chat_messages;
210 217 WPF()->db->delete(
211 218 $messages_table,
212 219 [ 'conversation_id' => $conversation_id ],