WordPress.org

Make WordPress Core

Ticket #36901: 36901.10.diff

File 36901.10.diff, 1.1 KB (added by boonebgorges, 3 years ago)
  • src/wp-includes/comment.php

    diff --git src/wp-includes/comment.php src/wp-includes/comment.php
    index b260ee8..36a277a 100644
    function wp_allow_comment( $commentdata, $avoid_die = false ) { 
    646646                 */
    647647                do_action( 'comment_duplicate_trigger', $commentdata );
    648648                if ( true === $avoid_die ) {
    649                         return new WP_Error( 'comment_duplicate', __( 'Duplicate comment detected; it looks as though you’ve already said that!' ), $dupe_id );
     649                        return new WP_Error( 'comment_duplicate', __( 'Duplicate comment detected; it looks as though you’ve already said that!' ), 409 );
    650650                } else {
    651651                        if ( wp_doing_ajax() ) {
    652652                                die( __('Duplicate comment detected; it looks as though you’ve already said that!') );
    function wp_allow_comment( $commentdata, $avoid_die = false ) { 
    702702        );
    703703
    704704        if ( $is_flood ) {
    705                 return new WP_Error( 'comment_flood', __( 'You are posting comments too quickly. Slow down.' ) );
     705                return new WP_Error( 'comment_flood', __( 'You are posting comments too quickly. Slow down.' ), 429 );
    706706        }
    707707
    708708        if ( ! empty( $commentdata['user_id'] ) ) {