Make WordPress Core

Ticket #44237: 44237.diff

File 44237.diff, 1.6 KB (added by mukesh27, 6 years ago)

Updated patch.

  • wp-includes/comment.php

    diff --git a/wp-includes/comment.php b/wp-includes/comment.php
    index d245026d66..77c5b4e6d7 100644
    a b function wp_allow_comment( $commentdata, $avoid_die = false ) { 
    744744        );
    745745
    746746        if ( $is_flood ) {
    747                 return new WP_Error( 'comment_flood', __( 'You are posting comments too quickly. Slow down.' ), 429 );
     747                /**
     748                 * Filters the comment flood message.
     749                 *
     750                 * @since 5.2.0
     751                 *
     752                 * @param string $comment_flood_message_filter Comment flood notification text.
     753                 */
     754                $comment_flood_message_filter = apply_filters( 'comment_flood_message_filter', __( 'You are posting comments too quickly. Slow down.' ) );
     755               
     756                return new WP_Error( 'comment_flood', $comment_flood_message_filter, 429 );
    748757        }
    749758
    750759        if ( ! empty( $commentdata['user_id'] ) ) {
    function wp_check_comment_flood( $is_flood, $ip, $email, $date, $avoid_die = fal 
    891900                        if ( true === $avoid_die ) {
    892901                                return true;
    893902                        } else {
     903                                /**
     904                                 * Filters the comment flood message.
     905                                 *
     906                                 * @since 5.2.0
     907                                 *
     908                                 * @param string $comment_flood_message_filter Comment flood notification text.
     909                                 */
     910                                $comment_flood_message_filter = apply_filters( 'comment_flood_message_filter', __( 'You are posting comments too quickly. Slow down.' ) );
     911
    894912                                if ( wp_doing_ajax() ) {
    895                                         die( __( 'You are posting comments too quickly. Slow down.' ) );
     913                                        die( $comment_flood_message_filter );
    896914                                }
    897915
    898                                 wp_die( __( 'You are posting comments too quickly. Slow down.' ), 429 );
     916                                wp_die( $comment_flood_message_filter, 429 );
    899917                        }
    900918                }
    901919        }