Skip to:
Content

BuddyPress.org

Ticket #4060: 4060-fix-search.001.patch

File 4060-fix-search.001.patch, 920 bytes (added by DJPaul, 13 years ago)
  • bp-core/bp-core-classes.php

    class BP_User_Query { 
    295295                // To avoid global joins, do a separate query
    296296                // @todo remove need for bp_is_active() check
    297297                if ( false !== $search_terms && bp_is_active( 'xprofile' ) ) {
    298                         $found_user_ids = $wpdb->get_col( $wpdb->prepare( "SELECT user_id FROM {$bp->profile->table_name_data} WHERE value LIKE %s", '%%' . like_escape( $search_terms ) . '%%' ), ARRAY_N );
     298                        $found_user_ids = $wpdb->get_col( $wpdb->prepare( "SELECT user_id FROM {$bp->profile->table_name_data} WHERE value LIKE %s", '%%' . like_escape( $search_terms ) . '%%' ) );
    299299
    300300                        if ( ! empty( $found_user_ids ) ) {
    301301                                $sql['where'][] = "u.{$this->uid_name} IN (" . implode( ',', wp_parse_id_list( $found_user_ids ) ) . ")";