Make WordPress Core

Changeset 33560


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

Comments: IDs are integers.

Merge of [33555] to the 3.8 branch.

File:
1 edited

Legend:

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

    r26664 r33560  
    25352535    foreach ( $group_by_status as $status => $comments ) {
    25362536        // Sanity check. This shouldn't happen.
    2537         if ( 'post-trashed' == $status )
     2537        if ( 'post-trashed' == $status ) {
    25382538            $status = '0';
    2539         $comments_in = implode( "', '", $comments );
    2540         $wpdb->query( "UPDATE $wpdb->comments SET comment_approved = '$status' WHERE comment_ID IN ('" . $comments_in . "')" );
     2539        }
     2540        $comments_in = implode( ', ', array_map( 'intval', $comments ) );
     2541        $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->comments SET comment_approved = %s WHERE comment_ID IN ($comments_in)", $status ) );
    25412542    }
    25422543
Note: See TracChangeset for help on using the changeset viewer.