Skip to content

Commit

Permalink
Fix empty links being created for the author's name comment (#44650)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucisu committed Oct 4, 2022
1 parent 2d0987b commit b1f1d56
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/block-library/src/comment-author-name/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -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( '<a rel="external nofollow ugc" href="%1s" target="%2s" >%3s</a>', esc_url( $link ), esc_attr( $attributes['linkTarget'] ), $comment_author );
}
if ( '0' === $comment->comment_approved && ! $show_pending_links ) {
Expand Down

0 comments on commit b1f1d56

Please sign in to comment.