Skip to content

Commit 28c0ded

Browse files
committed
Merge branch 'fix/7.0' into wp/7.0
2 parents a227954 + 0d1f792 commit 28c0ded

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • packages/block-library/src/post-date

‎packages/block-library/src/post-date/index.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,10 @@ function render_block_core_post_date( $attributes, $content, $block ) {
8181

8282
$wrapper_attributes = get_block_wrapper_attributes( array( 'class' => implode( ' ', $classes ) ) );
8383

84-
$time_tag = sprintf( '<time datetime="%1$s">%2$s</time>', $unformatted_date, $formatted_date );
84+
$time_tag = sprintf( '<time datetime="%1$s">%2$s</time>', esc_attr( $unformatted_date ), esc_html( $formatted_date ) );
8585

8686
if ( isset( $attributes['isLink'] ) && $attributes['isLink'] && isset( $block->context['postId'] ) ) {
87-
$time_tag = sprintf( '<a href="%1s">%2s</a>', get_the_permalink( $block->context['postId'] ), $time_tag );
87+
$time_tag = sprintf( '<a href="%1$s">%2$s</a>', esc_url( get_the_permalink( $block->context['postId'] ) ), $time_tag );
8888
}
8989

9090
return sprintf( '<div %1$s>%2$s</div>', $wrapper_attributes, $time_tag );

0 commit comments

Comments
 (0)