Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
08/05/2013 02:42:16 PM (13 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
  • trunk/bp-forums/bp-forums-functions.php

    r7298 r7338  
    463463        // Get the topic ids
    464464        foreach ( (array) $topics as $topic ) $topic_ids[] = $topic->topic_id;
    465         $topic_ids = $wpdb->escape( join( ',', (array) $topic_ids ) );
     465        $topic_ids = implode( ',', wp_parse_id_list( $topic_ids ) );
    466466
    467467        // Fetch the topic's last poster details
    … …  
    597597        // Get the user ids
    598598        foreach ( (array) $posts as $post ) $user_ids[] = $post->poster_id;
    599         $user_ids = $wpdb->escape( join( ',', (array) $user_ids ) );
     599        $user_ids = implode( ',', wp_parse_id_list( $user_ids ) );
    600600
    601601        // Fetch the poster's user_email, user_nicename and user_login
Note: See TracChangeset for help on using the changeset viewer.