Skip to content

Commit

Permalink
Escape comment author URL
Browse files Browse the repository at this point in the history
  • Loading branch information
zenaul authored and michalczaplinski committed Oct 18, 2022
1 parent 9ad568e commit 56c871a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/block-library/src/avatar/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ function render_block_core_avatar( $attributes, $content, $block ) {
$label = 'aria-label="' . sprintf( esc_attr__( '(%s website link, opens in a new tab)' ), $comment->comment_author ) . '"';
}
// translators: %1$s: Comment Author website link. %2$s: Link target. %3$s Aria label. %4$s Avatar image.
$avatar_block = sprintf( '<a href="%1$s" target="%2$s" %3$s class="wp-block-avatar__link">%4$s</a>', $comment->comment_author_url, esc_attr( $attributes['linkTarget'] ), $label, $avatar_block );
$avatar_block = sprintf( '<a href="%1$s" target="%2$s" %3$s class="wp-block-avatar__link">%4$s</a>', esc_url( $comment->comment_author_url ), esc_attr( $attributes['linkTarget'] ), $label, $avatar_block );
}
return sprintf( '<div %1s>%2s</div>', $wrapper_attributes, $avatar_block );
}
Expand Down

0 comments on commit 56c871a

Please sign in to comment.