X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/0461a5f2e55c8d5f1fde96ca2e83117152573c7d..9e77185fafaf4e60e2b73821e0e4b9b1a11fb85f:/wp-comments-post.php diff --git a/wp-comments-post.php b/wp-comments-post.php index 6196c368..0ed359c5 100644 --- a/wp-comments-post.php +++ b/wp-comments-post.php @@ -132,7 +132,11 @@ $comment_parent = isset($_POST['comment_parent']) ? absint($_POST['comment_paren $commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'comment_type', 'comment_parent', 'user_ID'); $comment_id = wp_new_comment( $commentdata ); -$comment = get_comment($comment_id); +if ( ! $comment_id ) { + wp_die( __( "ERROR: The comment could not be saved. Please try again later." ) ); +} + +$comment = get_comment( $comment_id ); /** * Perform other actions when comment cookies are set.