Code Duplication    Length = 6-6 lines in 5 locations

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

@@ 861-866 (lines=6) @@
858
		/** This action is documented in modules/carousel/jetpack-carousel.php */
859
		do_action( 'jp_carousel_check_blog_user_privileges' );
860
861
		if ( ! comments_open( $_post_id ) ) {
862
			if ( $switched ) {
863
				restore_current_blog();
864
			}
865
			die( json_encode( array( 'error' => __( 'Comments on this post are closed.', 'jetpack' ) ) ) );
866
		}
867
868
		if ( is_user_logged_in() ) {
869
			$user         = wp_get_current_user();
@@ 875-880 (lines=6) @@
872
			$email        = $user->user_email;
873
			$url          = $user->user_url;
874
875
			if ( empty( $user_id ) ) {
876
				if ( $switched ) {
877
					restore_current_blog();
878
				}
879
				die( json_encode( array( 'error' => __( 'Sorry, but we could not authenticate your request.', 'jetpack' ) ) ) );
880
			}
881
		} else {
882
			$user_id      = 0;
883
			$display_name = $_POST['author'];
@@ 888-893 (lines=6) @@
885
			$url          = $_POST['url'];
886
887
			if ( get_option( 'require_name_email' ) ) {
888
				if ( empty( $display_name ) ) {
889
					if ( $switched ) {
890
						restore_current_blog();
891
					}
892
					die( json_encode( array( 'error' => __( 'Please provide your name.', 'jetpack' ) ) ) );
893
				}
894
895
				if ( empty( $email ) ) {
896
					if ( $switched ) {
@@ 895-900 (lines=6) @@
892
					die( json_encode( array( 'error' => __( 'Please provide your name.', 'jetpack' ) ) ) );
893
				}
894
895
				if ( empty( $email ) ) {
896
					if ( $switched ) {
897
						restore_current_blog();
898
					}
899
					die( json_encode( array( 'error' => __( 'Please provide an email address.', 'jetpack' ) ) ) );
900
				}
901
902
				if ( ! is_email( $email ) ) {
903
					if ( $switched ) {
@@ 902-907 (lines=6) @@
899
					die( json_encode( array( 'error' => __( 'Please provide an email address.', 'jetpack' ) ) ) );
900
				}
901
902
				if ( ! is_email( $email ) ) {
903
					if ( $switched ) {
904
						restore_current_blog();
905
					}
906
					die( json_encode( array( 'error' => __( 'Please provide a valid email address.', 'jetpack' ) ) ) );
907
				}
908
			}
909
		}
910