WordPress.org

Make WordPress Core

Changeset 33556


Ignore:
Timestamp:
08/03/2015 09:38:43 PM (4 years ago)
Author:
ocean90
Message:

Comments: IDs are integers.

Merge of [33555] to the 4.2 branch.

File:
1 edited

Legend:

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

    r32384 r33556  
    29062906    foreach ( $group_by_status as $status => $comments ) {
    29072907        // Sanity check. This shouldn't happen.
    2908         if ( 'post-trashed' == $status )
     2908        if ( 'post-trashed' == $status ) {
    29092909            $status = '0';
    2910         $comments_in = implode( "', '", $comments );
    2911         $wpdb->query( "UPDATE $wpdb->comments SET comment_approved = '$status' WHERE comment_ID IN ('" . $comments_in . "')" );
     2910        }
     2911        $comments_in = implode( ', ', array_map( 'intval', $comments ) );
     2912        $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->comments SET comment_approved = %s WHERE comment_ID IN ($comments_in)", $status ) );
    29122913    }
    29132914
Note: See TracChangeset for help on using the changeset viewer.