Make WordPress Core

Ticket #44237: 44237-flood.1.diff

File 44237-flood.1.diff, 939 bytes (added by odminstudios, 7 years ago)

Flood text message

  • src/wp-includes/comment.php

    diff --git src/wp-includes/comment.php src/wp-includes/comment.php
    index 4c78eb9..7293e23 100644
    function wp_check_comment_flood( $is_flood, $ip, $email, $date, $avoid_die = fal 
    902902                        if ( true === $avoid_die ) {
    903903                                return true;
    904904                        } else {
     905                                /**
     906                                 * Filters flood comment message.
     907                                 *
     908                                 * @since 5.0
     909                                 *
     910                                 * @param string $comment_flood_filter_message Flood notification text.
     911                                 */
     912                                $comment_flood_filter_message = apply_filters( 'comment_flood_filter_message', __( 'You are posting comments too quickly. Slow down.' ) );
    905913                                if ( wp_doing_ajax() ) {
    906                                         die( __( 'You are posting comments too quickly. Slow down.' ) );
     914                                        die( $comment_flood_filter_message );
    907915                                }
    908916
    909                                 wp_die( __( 'You are posting comments too quickly. Slow down.' ), 429 );
     917                                wp_die( $comment_flood_filter_message, 429 );
    910918                        }
    911919                }
    912920        }