Make WordPress Core

Ticket #58515: 58515-1.2.diff

File 58515-1.2.diff, 962 bytes (added by nihar007, 2 years ago)

A new patch added

  • src/wp-includes/comment.php

    diff --git a/src/wp-includes/comment.php b/src/wp-includes/comment.php
    index 5d87da2890..2e89f0e8ca 100644
    a b function _prime_comment_caches( $comment_ids, $update_meta_cache = true ) { 
    33363336
    33373337        $non_cached_ids = _get_non_cached_ids( $comment_ids, 'comment' );
    33383338        if ( ! empty( $non_cached_ids ) ) {
    3339                 $fresh_comments = $wpdb->get_results( sprintf( "SELECT $wpdb->comments.* FROM $wpdb->comments WHERE comment_ID IN (%s)", implode( ',', array_map( 'intval', $non_cached_ids ) ) ) );
     3339                $non_cached_ids = array_map( 'intval', $non_cached_ids );
     3340                $non_cached_id_placeholder = implode( ',',  array_fill( 0, count( $non_cached_ids ), '%d' ) );
     3341               
     3342                $fresh_comments = $wpdb->get_results( $wpdb->prepare( "SELECT $wpdb->comments.* FROM $wpdb->comments WHERE comment_ID IN ($non_cached_id_placeholder)", $non_cached_ids ) );
    33403343
    33413344                update_comment_cache( $fresh_comments, false );
    33423345        }