Make WordPress Core

Changeset 33561 for branches/3.7/src


Ignore:
Timestamp:
08/03/2015 09:40:19 PM (9 years ago)
Author:
ocean90
Message:

Comments: IDs are integers.

Merge of [33555] to the 3.7 branch.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.7/src/wp-includes/post.php

    r25976 r33561  
    25282528    foreach ( $group_by_status as $status => $comments ) {
    25292529        // Sanity check. This shouldn't happen.
    2530         if ( 'post-trashed' == $status )
     2530        if ( 'post-trashed' == $status ) {
    25312531            $status = '0';
    2532         $comments_in = implode( "', '", $comments );
    2533         $wpdb->query( "UPDATE $wpdb->comments SET comment_approved = '$status' WHERE comment_ID IN ('" . $comments_in . "')" );
     2532        }
     2533        $comments_in = implode( ', ', array_map( 'intval', $comments ) );
     2534        $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->comments SET comment_approved = %s WHERE comment_ID IN ($comments_in)", $status ) );
    25342535    }
    25352536
Note: See TracChangeset for help on using the changeset viewer.