Skip to content

Commit

Permalink
Comments: IDs are integers.
Browse files Browse the repository at this point in the history
Merge of [33555] to the 3.8 branch.
Built from https://develop.svn.wordpress.org/branches/3.8@33560


git-svn-id: http://core.svn.wordpress.org/branches/3.8@33527 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
ocean90 committed Aug 4, 2015
1 parent 6d3a23c commit 0128210
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions wp-includes/post.php
Expand Up @@ -2534,10 +2534,11 @@ function wp_untrash_post_comments($post = null) {

foreach ( $group_by_status as $status => $comments ) {
// Sanity check. This shouldn't happen.
if ( 'post-trashed' == $status )
if ( 'post-trashed' == $status ) {
$status = '0';
$comments_in = implode( "', '", $comments );
$wpdb->query( "UPDATE $wpdb->comments SET comment_approved = '$status' WHERE comment_ID IN ('" . $comments_in . "')" );
}
$comments_in = implode( ', ', array_map( 'intval', $comments ) );
$wpdb->query( $wpdb->prepare( "UPDATE $wpdb->comments SET comment_approved = %s WHERE comment_ID IN ($comments_in)", $status ) );
}

clean_comment_cache( array_keys($statuses) );
Expand Down

0 comments on commit 0128210

Please sign in to comment.