Code Duplication    Length = 6-6 lines in 5 locations

projects/plugins/jetpack/modules/carousel/jetpack-carousel.php 5 locations

@@ 800-805 (lines=6) @@
797
		/** This action is documented in modules/carousel/jetpack-carousel.php */
798
		do_action( 'jp_carousel_check_blog_user_privileges' );
799
800
		if ( ! comments_open( $_post_id ) ) {
801
			if ( $switched ) {
802
				restore_current_blog();
803
			}
804
			die( json_encode( array( 'error' => __( 'Comments on this post are closed.', 'jetpack' ) ) ) );
805
		}
806
807
		if ( is_user_logged_in() ) {
808
			$user         = wp_get_current_user();
@@ 814-819 (lines=6) @@
811
			$email        = $user->user_email;
812
			$url          = $user->user_url;
813
814
			if ( empty( $user_id ) ) {
815
				if ( $switched ) {
816
					restore_current_blog();
817
				}
818
				die( json_encode( array( 'error' => __( 'Sorry, but we could not authenticate your request.', 'jetpack' ) ) ) );
819
			}
820
		} else {
821
			$user_id      = 0;
822
			$display_name = $_POST['author'];
@@ 827-832 (lines=6) @@
824
			$url          = $_POST['url'];
825
826
			if ( get_option( 'require_name_email' ) ) {
827
				if ( empty( $display_name ) ) {
828
					if ( $switched ) {
829
						restore_current_blog();
830
					}
831
					die( json_encode( array( 'error' => __( 'Please provide your name.', 'jetpack' ) ) ) );
832
				}
833
834
				if ( empty( $email ) ) {
835
					if ( $switched ) {
@@ 834-839 (lines=6) @@
831
					die( json_encode( array( 'error' => __( 'Please provide your name.', 'jetpack' ) ) ) );
832
				}
833
834
				if ( empty( $email ) ) {
835
					if ( $switched ) {
836
						restore_current_blog();
837
					}
838
					die( json_encode( array( 'error' => __( 'Please provide an email address.', 'jetpack' ) ) ) );
839
				}
840
841
				if ( ! is_email( $email ) ) {
842
					if ( $switched ) {
@@ 841-846 (lines=6) @@
838
					die( json_encode( array( 'error' => __( 'Please provide an email address.', 'jetpack' ) ) ) );
839
				}
840
841
				if ( ! is_email( $email ) ) {
842
					if ( $switched ) {
843
						restore_current_blog();
844
					}
845
					die( json_encode( array( 'error' => __( 'Please provide a valid email address.', 'jetpack' ) ) ) );
846
				}
847
			}
848
		}
849