Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
08/05/2013 02:41:51 PM (11 years ago)
Author:
boonebgorges
Message:

Use esc_sql() instead of $wpdb->escape() throughout

WordPress 3.6 deprecated the use of $wpdb->escape() for sanitizing SQL
query fragments, in favor of the rewritten esc_sql(). This changeset
makes the appropriate changes throughout BuddyPress.

In a few places, this changeset also removes redundant sanitization, in
particular when using wp_parse_id_list().

Also adds a unit test for a touched method (BP_User_Query, when using
the 'exclude' parameter).

Fixes #5100

Props needle

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.8/bp-activity/bp-activity-classes.php

    r7324 r7337  
    173173        // Searching
    174174        if ( $search_terms ) {
    175             $search_terms = $wpdb->escape( $search_terms );
     175            $search_terms = esc_sql( $search_terms );
    176176            $where_conditions['search_sql'] = "a.content LIKE '%%" . esc_sql( like_escape( $search_terms ) ) . "%%'";
    177177        }
Note: See TracChangeset for help on using the changeset viewer.