From d4c6ebeb89cea02a87ab4c7226ea7e24033de1ad Mon Sep 17 00:00:00 2001 From: whyisjake Date: Fri, 27 Sep 2019 14:46:57 +0000 Subject: [PATCH] Comments: Avoid PHP notice in `get_comment_reply_link()` for `null` comment. If there is no global comment, or the input comment is null, return early to prevent warnings. Fixes #41846 Props birgire, earnjam Built from https://develop.svn.wordpress.org/trunk@46335 git-svn-id: http://core.svn.wordpress.org/trunk@46134 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/comment-template.php | 4 ++++ wp-includes/version.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/wp-includes/comment-template.php b/wp-includes/comment-template.php index b10fe1415e..69dcc1629a 100644 --- a/wp-includes/comment-template.php +++ b/wp-includes/comment-template.php @@ -1646,6 +1646,10 @@ function get_comment_reply_link( $args = array(), $comment = null, $post = null $comment = get_comment( $comment ); + if ( empty( $comment ) ) { + return; + } + if ( empty( $post ) ) { $post = $comment->comment_post_ID; } diff --git a/wp-includes/version.php b/wp-includes/version.php index d6afba685f..2a0a38a403 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.3-beta1-46334'; +$wp_version = '5.3-beta1-46335'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.