Skip to:
Content

BuddyPress.org

Changeset 6497


Ignore:
Timestamp:
11/08/2012 07:37:09 PM (12 years ago)
Author:
johnjamesjacoby
Message:

Remove incorrect prepare() usages in bp-messages-classes.php.

File:
1 edited

Legend:

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

    r6413 r6497  
    145145
    146146        if ( $type == 'unread' )
    147             $type_sql = $wpdb->prepare( " AND r.unread_count != 0 " );
     147            $type_sql = " AND r.unread_count != 0 ";
    148148        elseif ( $type == 'read' )
    149             $type_sql = $wpdb->prepare( " AND r.unread_count = 0 " );
     149            $type_sql = " AND r.unread_count = 0 ";
    150150
    151151        if ( !empty( $search_terms ) ) {
     
    200200
    201201        if ( $type == 'unread' )
    202             $type_sql = $wpdb->prepare( " AND unread_count != 0 " );
     202            $type_sql = " AND unread_count != 0 ";
    203203        else if ( $type == 'read' )
    204             $type_sql = $wpdb->prepare( " AND unread_count = 0 " );
     204            $type_sql = " AND unread_count = 0 ";
    205205
    206206        return (int) $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(thread_id) FROM {$bp->messages->table_name_recipients} WHERE user_id = %d AND is_deleted = 0$exclude_sender $type_sql", $user_id ) );
     
    283283        $bp_prefix = bp_core_get_table_prefix();
    284284        $errors    = false;
    285         $threads   = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$bp_prefix}bp_messages_threads" ) );
     285        $threads   = $wpdb->get_results( "SELECT * FROM {$bp_prefix}bp_messages_threads" );
    286286
    287287        // Nothing to update, just return true to remove the table
     
    358358        // If we have no thread_id then this is the first message of a new thread.
    359359        if ( empty( $this->thread_id ) ) {
    360             $this->thread_id = (int) $wpdb->get_var( $wpdb->prepare( "SELECT MAX(thread_id) FROM {$bp->messages->table_name_messages}" ) ) + 1;
     360            $this->thread_id = (int) $wpdb->get_var( "SELECT MAX(thread_id) FROM {$bp->messages->table_name_messages}" ) + 1;
    361361            $new_thread = true;
    362362        }
     
    540540        }
    541541
    542         $notices = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$bp->messages->table_name_notices} ORDER BY date_sent DESC {$limit_sql}" ) );
     542        $notices = $wpdb->get_results( "SELECT * FROM {$bp->messages->table_name_notices} ORDER BY date_sent DESC {$limit_sql}" );
    543543
    544544        return $notices;
     
    548548        global $wpdb, $bp;
    549549
    550         $notice_count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(id) FROM " . $bp->messages->table_name_notices ) );
     550        $notice_count = $wpdb->get_var( "SELECT COUNT(id) FROM " . $bp->messages->table_name_notices );
    551551
    552552        return $notice_count;
     
    556556        global $wpdb, $bp;
    557557
    558         $notice_id = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->messages->table_name_notices} WHERE is_active = 1" ) );
     558        $notice_id = $wpdb->get_var( "SELECT id FROM {$bp->messages->table_name_notices} WHERE is_active = 1" );
     559
    559560        return new BP_Messages_Notice( $notice_id );
    560561    }
Note: See TracChangeset for help on using the changeset viewer.