]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-comments-post.php
WordPress 4.3-scripts
[autoinstalls/wordpress.git] / wp-comments-post.php
index 0ed359c5bb763161ee98783ae0dd96b52c548c71..e1e41720a40d81e2bf6c5d2d958a2ef39996d690 100644 (file)
@@ -47,7 +47,7 @@ if ( ! comments_open( $comment_post_ID ) ) {
         * @param int $comment_post_ID Post ID.
         */
        do_action( 'comment_closed', $comment_post_ID );
         * @param int $comment_post_ID Post ID.
         */
        do_action( 'comment_closed', $comment_post_ID );
-       wp_die( __('Sorry, comments are closed for this item.') );
+       wp_die( __( 'Sorry, comments are closed for this item.' ), 403 );
 } elseif ( 'trash' == $status ) {
        /**
         * Fires when a comment is attempted on a trashed post.
 } elseif ( 'trash' == $status ) {
        /**
         * Fires when a comment is attempted on a trashed post.
@@ -111,21 +111,24 @@ if ( $user->exists() ) {
                }
        }
 } else {
                }
        }
 } else {
-       if ( get_option('comment_registration') || 'private' == $status )
-               wp_die( __('Sorry, you must be logged in to post a comment.') );
+       if ( get_option( 'comment_registration' ) || 'private' == $status ) {
+               wp_die( __( 'Sorry, you must be logged in to post a comment.' ), 403 );
+       }
 }
 
 $comment_type = '';
 
 if ( get_option('require_name_email') && !$user->exists() ) {
 }
 
 $comment_type = '';
 
 if ( get_option('require_name_email') && !$user->exists() ) {
-       if ( 6 > strlen($comment_author_email) || '' == $comment_author )
-               wp_die( __('<strong>ERROR</strong>: please fill the required fields (name, email).') );
-       elseif ( !is_email($comment_author_email))
-               wp_die( __('<strong>ERROR</strong>: please enter a valid email address.') );
+       if ( 6 > strlen( $comment_author_email ) || '' == $comment_author ) {
+               wp_die( __( '<strong>ERROR</strong>: please fill the required fields (name, email).' ), 200 );
+       } elseif ( ! is_email( $comment_author_email ) ) {
+               wp_die( __( '<strong>ERROR</strong>: please enter a valid email address.' ), 200 );
+       }
 }
 
 }
 
-if ( '' == $comment_content )
-       wp_die( __('<strong>ERROR</strong>: please type a comment.') );
+if ( '' == $comment_content ) {
+       wp_die( __( '<strong>ERROR</strong>: please type a comment.' ), 200 );
+}
 
 $comment_parent = isset($_POST['comment_parent']) ? absint($_POST['comment_parent']) : 0;
 
 
 $comment_parent = isset($_POST['comment_parent']) ? absint($_POST['comment_parent']) : 0;