Code Duplication    Length = 15-16 lines in 3 locations

src/wp-includes/comment.php 3 locations

@@ 545-560 (lines=16) @@
542
 * @since 2.0.4
543
 */
544
function sanitize_comment_cookies() {
545
	if ( isset( $_COOKIE['comment_author_' . COOKIEHASH] ) ) {
546
		/**
547
		 * Filters the comment author's name cookie before it is set.
548
		 *
549
		 * When this filter hook is evaluated in wp_filter_comment(),
550
		 * the comment author's name string is passed.
551
		 *
552
		 * @since 1.5.0
553
		 *
554
		 * @param string $author_cookie The comment author name cookie.
555
		 */
556
		$comment_author = apply_filters( 'pre_comment_author_name', $_COOKIE['comment_author_' . COOKIEHASH] );
557
		$comment_author = wp_unslash($comment_author);
558
		$comment_author = esc_attr($comment_author);
559
		$_COOKIE['comment_author_' . COOKIEHASH] = $comment_author;
560
	}
561
562
	if ( isset( $_COOKIE['comment_author_email_' . COOKIEHASH] ) ) {
563
		/**
@@ 562-577 (lines=16) @@
559
		$_COOKIE['comment_author_' . COOKIEHASH] = $comment_author;
560
	}
561
562
	if ( isset( $_COOKIE['comment_author_email_' . COOKIEHASH] ) ) {
563
		/**
564
		 * Filters the comment author's email cookie before it is set.
565
		 *
566
		 * When this filter hook is evaluated in wp_filter_comment(),
567
		 * the comment author's email string is passed.
568
		 *
569
		 * @since 1.5.0
570
		 *
571
		 * @param string $author_email_cookie The comment author email cookie.
572
		 */
573
		$comment_author_email = apply_filters( 'pre_comment_author_email', $_COOKIE['comment_author_email_' . COOKIEHASH] );
574
		$comment_author_email = wp_unslash($comment_author_email);
575
		$comment_author_email = esc_attr($comment_author_email);
576
		$_COOKIE['comment_author_email_'.COOKIEHASH] = $comment_author_email;
577
	}
578
579
	if ( isset( $_COOKIE['comment_author_url_' . COOKIEHASH] ) ) {
580
		/**
@@ 579-593 (lines=15) @@
576
		$_COOKIE['comment_author_email_'.COOKIEHASH] = $comment_author_email;
577
	}
578
579
	if ( isset( $_COOKIE['comment_author_url_' . COOKIEHASH] ) ) {
580
		/**
581
		 * Filters the comment author's URL cookie before it is set.
582
		 *
583
		 * When this filter hook is evaluated in wp_filter_comment(),
584
		 * the comment author's URL string is passed.
585
		 *
586
		 * @since 1.5.0
587
		 *
588
		 * @param string $author_url_cookie The comment author URL cookie.
589
		 */
590
		$comment_author_url = apply_filters( 'pre_comment_author_url', $_COOKIE['comment_author_url_' . COOKIEHASH] );
591
		$comment_author_url = wp_unslash($comment_author_url);
592
		$_COOKIE['comment_author_url_'.COOKIEHASH] = $comment_author_url;
593
	}
594
}
595
596
/**