Make WordPress Core

Ticket #58544: 58544.patch

File 58544.patch, 1.3 KB (added by hiren1094, 20 months ago)

Patch Added

  • src/wp-includes/comment.php

    diff --git a/src/wp-includes/comment.php b/src/wp-includes/comment.php
    index 5d87da2890..eedfd85407 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                $fresh_comments = $wpdb->get_results( $wpdb->prepare( "SELECT $wpdb->comments.* FROM $wpdb->comments WHERE comment_ID IN (%s)", implode( ',', array_map( 'intval', $non_cached_ids ) ) ) );
    33403340
    33413341                update_comment_cache( $fresh_comments, false );
    33423342        }
    function wp_handle_comment_submission( $comment_data ) { 
    36333633                        return new WP_Error( 'require_valid_email', __( '<strong>Error:</strong> Please enter a valid email address.' ), 200 );
    36343634                }
    36353635        }
    3636 
     3636       
     3637        // Check validation for safe url.
     3638        if ( '' !== $comment_author_url && ! $user->exists() && empty( wp_http_validate_url( $comment_author_url ) ) ) {
     3639                return new WP_Error( 'require_valid_url', __( '<strong>Error:</strong> Website url is invalid.' ), 200 );
     3640        }
     3641       
    36373642        $commentdata = array(
    36383643                'comment_post_ID' => $comment_post_id,
    36393644        );