From b1f1d562a5c60f6319a031b5675f1f3b2aec9a59 Mon Sep 17 00:00:00 2001 From: Lucisu <46996317+Lucisu@users.noreply.github.com> Date: Tue, 4 Oct 2022 10:13:13 +0200 Subject: [PATCH] Fix empty links being created for the author's name comment (#44650) --- packages/block-library/src/comment-author-name/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/block-library/src/comment-author-name/index.php b/packages/block-library/src/comment-author-name/index.php index 41ab4386069e9d..04d8e60c65e8ca 100644 --- a/packages/block-library/src/comment-author-name/index.php +++ b/packages/block-library/src/comment-author-name/index.php @@ -34,7 +34,7 @@ function render_block_core_comment_author_name( $attributes, $content, $block ) $comment_author = get_comment_author( $comment ); $link = get_comment_author_url( $comment ); - if ( ! empty( $attributes['isLink'] ) && ! empty( $attributes['linkTarget'] ) ) { + if ( ! empty( $link ) && ! empty( $attributes['isLink'] ) && ! empty( $attributes['linkTarget'] ) ) { $comment_author = sprintf( '%3s', esc_url( $link ), esc_attr( $attributes['linkTarget'] ), $comment_author ); } if ( '0' === $comment->comment_approved && ! $show_pending_links ) {