Skip to:
Content

BuddyPress.org

Changeset 7710


Ignore:
Timestamp:
12/21/2013 12:40:12 PM (11 years ago)
Author:
djpaul
Message:

xprofile: remove unnecessary $wpdb->prepare in BP_XProfile_ProfileData->get_random().

Props graham-washbrook for initial patch, fixes #5309

File:
1 edited

Legend:

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

    r7708 r7710  
    12651265        global $wpdb, $bp;
    12661266
    1267         if ( !empty( $exclude_fullname ) )
    1268             $exclude_sql = $wpdb->prepare( " AND pf.id != 1" );
     1267        $exclude_sql = ! empty( $exclude_fullname ) ? ' AND pf.id != 1' : '';
    12691268
    12701269        return $wpdb->get_results( $wpdb->prepare( "SELECT pf.type, pf.name, pd.value FROM {$bp->profile->table_name_data} pd INNER JOIN {$bp->profile->table_name_fields} pf ON pd.field_id = pf.id AND pd.user_id = %d {$exclude_sql} ORDER BY RAND() LIMIT 1", $user_id ) );
Note: See TracChangeset for help on using the changeset viewer.