Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
05/08/2013 02:50:46 AM (11 years ago)
Author:
johnjamesjacoby
Message:

More array sanitization hardening using wp_parse_id_list() in bp-groups-classes.php. See #4989 (trunk)

File:
1 edited

Legend:

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

    r7017 r7021  
    174174        // Fetch the user IDs of all the members of the group
    175175        $user_ids    = BP_Groups_Member::get_group_member_ids( $this->id );
    176         $user_id_str = implode( ',', (array) $user_ids );
     176        $user_id_str = esc_sql( implode( ',', wp_parse_id_list( $user_ids ) ) );
    177177
    178178        // Modify group count usermeta for members
     
    233233            return false;
    234234
    235         $gids = implode( ',', $gids['groups'] );
     235        $gids = esc_sql( implode( ',', wp_parse_id_list( $gids['groups'] ) ) );
    236236
    237237        $paged_groups = $wpdb->get_results( "SELECT id as group_id FROM {$bp->groups->table_name} WHERE ( name LIKE '{$filter}%%' OR description LIKE '{$filter}%%' ) AND id IN ({$gids}) {$pag_sql}" );
     
    703703
    704704        // Sanitize group IDs
    705         $group_ids = wp_parse_id_list( $group_ids );
    706         $group_ids = implode( ',', $group_ids );
     705        $group_ids = implode( ',', wp_parse_id_list( $group_ids ) );
    707706
    708707        // Fetch the logged in users status within each group
     
    13301329            $user_ids[] = $user->user_id;
    13311330
    1332         $user_ids = $wpdb->escape( join( ',', (array) $user_ids ) );
     1331        $user_ids = implode( ',', wp_parse_id_list( $user_ids ) );
    13331332
    13341333        if ( bp_is_active( 'friends' ) ) {
Note: See TracChangeset for help on using the changeset viewer.