Changeset 5138
- Timestamp:
- 09/09/2011 09:59:30 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.2/bp-activity/bp-activity-classes.php
r4111 r5138 171 171 172 172 if ( is_array( $activity_ids ) ) 173 $activity_ids = implode ( ',', $activity_ids);174 175 $activity_ids = $wpdb->escape( $activity_ids);173 $activity_ids = implode ( ',', array_map( 'absint', $activity_ids ) ); 174 else 175 $activity_ids = implode ( ',', array_map( 'absint', explode ( ',', $activity_ids ) ) ); 176 176 177 177 if ( empty( $activity_ids ) ) … … 320 320 global $bp, $wpdb; 321 321 322 if ( is_array( $activity_ids) )323 $activity_ids = implode ( ',', $activity_ids);324 325 $activity_ids = $wpdb->escape( $activity_ids);322 if ( is_array( $activity_ids ) ) 323 $activity_ids = implode ( ',', array_map( 'absint', $activity_ids ) ); 324 else 325 $activity_ids = implode ( ',', array_map( 'absint', explode ( ',', $activity_ids ) ) ); 326 326 327 327 return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->activity->table_name} WHERE type = 'activity_comment' AND item_id IN ({$activity_ids})" ) ); … … 331 331 global $bp, $wpdb; 332 332 333 if ( is_array( $activity_ids) )334 $activity_ids = implode ( ',', $activity_ids);335 336 $activity_ids = $wpdb->escape( $activity_ids);333 if ( is_array( $activity_ids ) ) 334 $activity_ids = implode ( ',', array_map( 'absint', $activity_ids ) ); 335 else 336 $activity_ids = implode ( ',', array_map( 'absint', explode ( ',', $activity_ids ) ) ); 337 337 338 338 return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->activity->table_name_meta} WHERE activity_id IN ({$activity_ids})" ) );
Note: See TracChangeset
for help on using the changeset viewer.