diff --git a/src/wp-comments-post.php b/src/wp-comments-post.php index 2fb148a8dc..4fb249badb 100644 --- a/src/wp-comments-post.php +++ b/src/wp-comments-post.php @@ -19,9 +19,9 @@ nocache_headers(); $comment = wp_handle_comment_submission( wp_unslash( $_POST ) ); if ( is_wp_error( $comment ) ) { - $data = $comment->get_error_data(); + $data = intval( $comment->get_error_data() ); if ( ! empty( $data ) ) { - wp_die( $comment->get_error_message(), $data ); + wp_die( '
' . $comment->get_error_message() . '
', __( 'Comment Submission Failure' ), array( 'response' => $data, 'back_link' => true ) ); } else { exit; }