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