Code Duplication    Length = 14-16 lines in 2 locations

wp-includes/comment.php 2 locations

@@ 626-639 (lines=14) @@
623
	 */
624
	$dupe_id = apply_filters( 'duplicate_comment_id', $dupe_id, $commentdata );
625
626
	if ( $dupe_id ) {
627
		/**
628
		 * Fires immediately after a duplicate comment is detected.
629
		 *
630
		 * @since 3.0.0
631
		 *
632
		 * @param array $commentdata Comment data.
633
		 */
634
		do_action( 'comment_duplicate_trigger', $commentdata );
635
		if ( defined( 'DOING_AJAX' ) ) {
636
			die( __('Duplicate comment detected; it looks as though you’ve already said that!') );
637
		}
638
		wp_die( __( 'Duplicate comment detected; it looks as though you’ve already said that!' ), 409 );
639
	}
640
641
	/**
642
	 * Fires immediately before a comment is marked approved.
@@ 760-775 (lines=16) @@
757
		 * @param int  $time_newcomment  Timestamp of when the new comment was posted.
758
		 */
759
		$flood_die = apply_filters( 'comment_flood_filter', false, $time_lastcomment, $time_newcomment );
760
		if ( $flood_die ) {
761
			/**
762
			 * Fires before the comment flood message is triggered.
763
			 *
764
			 * @since 1.5.0
765
			 *
766
			 * @param int $time_lastcomment Timestamp of when the last comment was posted.
767
			 * @param int $time_newcomment  Timestamp of when the new comment was posted.
768
			 */
769
			do_action( 'comment_flood_trigger', $time_lastcomment, $time_newcomment );
770
771
			if ( defined('DOING_AJAX') )
772
				die( __('You are posting comments too quickly. Slow down.') );
773
774
			wp_die( __( 'You are posting comments too quickly. Slow down.' ), 429 );
775
		}
776
	}
777
}
778