~canonical-sysadmins/wordpress/4.7

« back to all changes in this revision

Viewing changes to wp-includes/post.php

  • Committer: Ryan Finnie
  • Date: 2015-08-31 16:03:58 UTC
  • mto: This revision was merged to the branch mainline in revision 10.
  • Revision ID: ryan.finnie@canonical.com-20150831160358-32iuabgkh61u3sme
new upstream release 4.2.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
2905
2905
 
2906
2906
        foreach ( $group_by_status as $status => $comments ) {
2907
2907
                // Sanity check. This shouldn't happen.
2908
 
                if ( 'post-trashed' == $status )
 
2908
                if ( 'post-trashed' == $status ) {
2909
2909
                        $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 ) );
2912
2913
        }
2913
2914
 
2914
2915
        clean_comment_cache( array_keys($statuses) );