Make WordPress Core

Changeset 33559


Ignore:
Timestamp:
08/03/2015 09:39:49 PM (11 years ago)
Author:
ocean90
Message:

Comments: IDs are integers.

Merge of [33555] to the 3.9 branch.

File:
1 edited

Legend:

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

    r28106 r33559  
    27372737    foreach ( $group_by_status as $status => $comments ) {
    27382738        // Sanity check. This shouldn't happen.
    2739         if ( 'post-trashed' == $status )
     2739        if ( 'post-trashed' == $status ) {
    27402740            $status = '0';
    2741         $comments_in = implode( "', '", $comments );
    2742         $wpdb->query( "UPDATE $wpdb->comments SET comment_approved = '$status' WHERE comment_ID IN ('" . $comments_in . "')" );
     2741        }
     2742        $comments_in = implode( ', ', array_map( 'intval', $comments ) );
     2743        $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->comments SET comment_approved = %s WHERE comment_ID IN ($comments_in)", $status ) );
    27432744    }
    27442745
Note: See TracChangeset for help on using the changeset viewer.