diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php index 3ec49867ce..61fb044254 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php @@ -1041,8 +1041,10 @@ class WP_REST_Comments_Controller extends WP_REST_Controller { $prepared_comment['comment_author_IP'] = $request['author_ip']; } - if ( isset( $request['author_user_agent'] ) ) { + if ( ! empty( $request['author_user_agent'] ) ) { $prepared_comment['comment_agent'] = $request['author_user_agent']; + } elseif ( $request->get_header( 'user_agent' ) ) { + $prepared_comment['comment_agent'] = $request->get_header( 'user_agent' ); } if ( isset( $request['type'] ) ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index 329cacbeb6..bcfc3dbee1 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.7-beta4-39286'; +$wp_version = '4.7-beta4-39287'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.