From e55ca10ddc9caa1132d3f2da1e1387b68e69cd3e Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sun, 26 Apr 2020 13:44:07 +0000 Subject: [PATCH] Comments: Ensure that inserting a comment with an empty type results in correct `comment` type. Add unit tests for `wp_handle_comment_submission()` and `wp_insert_comment()` receiving an empty type. Follow-up to [47597]. Props ocean90, imath. Fixes #49236. Built from https://develop.svn.wordpress.org/trunk@47626 git-svn-id: http://core.svn.wordpress.org/trunk@47401 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/comment.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/comment.php b/wp-includes/comment.php index 87ed753c17..8648a89a0f 100644 --- a/wp-includes/comment.php +++ b/wp-includes/comment.php @@ -1912,7 +1912,7 @@ function wp_insert_comment( $commentdata ) { $comment_karma = ! isset( $data['comment_karma'] ) ? 0 : $data['comment_karma']; $comment_approved = ! isset( $data['comment_approved'] ) ? 1 : $data['comment_approved']; $comment_agent = ! isset( $data['comment_agent'] ) ? '' : $data['comment_agent']; - $comment_type = ! isset( $data['comment_type'] ) ? 'comment' : $data['comment_type']; + $comment_type = empty( $data['comment_type'] ) ? 'comment' : $data['comment_type']; $comment_parent = ! isset( $data['comment_parent'] ) ? 0 : $data['comment_parent']; $user_id = ! isset( $data['user_id'] ) ? 0 : $data['user_id']; diff --git a/wp-includes/version.php b/wp-includes/version.php index 5272d1647b..ea0dc24566 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.5-alpha-47625'; +$wp_version = '5.5-alpha-47626'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.