Skip to:
Content

BuddyPress.org

Changeset 8661


Ignore:
Timestamp:
07/22/2014 06:09:59 PM (10 years ago)
Author:
johnjamesjacoby
Message:

Remove incorrect prepare() usage in get_current_threads_for_user(). See #5388.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-messages/bp-messages-classes.php

    r8620 r8661  
    271271            $user_id_sql = $wpdb->prepare( 'm.sender_id = %d', $user_id );
    272272            $thread_ids  = $wpdb->get_results( "SELECT m.thread_id, MAX(m.date_sent) AS date_sent FROM {$bp->messages->table_name_recipients} r, {$bp->messages->table_name_messages} m WHERE m.thread_id = r.thread_id AND m.sender_id = r.user_id AND {$user_id_sql} AND r.is_deleted = 0 {$search_sql} GROUP BY m.thread_id ORDER BY date_sent DESC {$pag_sql}" );
    273             $total_threads = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT( DISTINCT m.thread_id ) FROM {$bp->messages->table_name_recipients} r, {$bp->messages->table_name_messages} m WHERE m.thread_id = r.thread_id AND m.sender_id = r.user_id AND {$user_id_sql} AND r.is_deleted = 0 {$search_sql} ", $user_id ) );
     273            $total_threads = $wpdb->get_var( "SELECT COUNT( DISTINCT m.thread_id ) FROM {$bp->messages->table_name_recipients} r, {$bp->messages->table_name_messages} m WHERE m.thread_id = r.thread_id AND m.sender_id = r.user_id AND {$user_id_sql} AND r.is_deleted = 0 {$search_sql} " );
    274274        } else {
    275275            $user_id_sql = $wpdb->prepare( 'r.user_id = %d', $user_id );
Note: See TracChangeset for help on using the changeset viewer.