Skip to content

Commit

Permalink
Use esc_url() when constructing the href for the post-title block (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
tellyworth authored Oct 2, 2023
1 parent 1187fe6 commit d2e6ed6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/block-library/src/post-title/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function render_block_core_post_title( $attributes, $content, $block ) {

if ( isset( $attributes['isLink'] ) && $attributes['isLink'] ) {
$rel = ! empty( $attributes['rel'] ) ? 'rel="' . esc_attr( $attributes['rel'] ) . '"' : '';
$title = sprintf( '<a href="%1$s" target="%2$s" %3$s>%4$s</a>', get_the_permalink( $block->context['postId'] ), esc_attr( $attributes['linkTarget'] ), $rel, $title );
$title = sprintf( '<a href="%1$s" target="%2$s" %3$s>%4$s</a>', esc_url( get_the_permalink( $block->context['postId'] ) ), esc_attr( $attributes['linkTarget'] ), $rel, $title );
}

$classes = array();
Expand Down

1 comment on commit d2e6ed6

@github-actions
Copy link

@github-actions github-actions bot commented on d2e6ed6 Oct 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in d2e6ed6.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6377466719
📝 Reported issues:

Please sign in to comment.