diff -r be944660c56a -r 3d72ae0968f4 wp/wp-includes/blocks/post-title.php --- a/wp/wp-includes/blocks/post-title.php Wed Sep 21 18:19:35 2022 +0200 +++ b/wp/wp-includes/blocks/post-title.php Tue Sep 27 16:37:53 2022 +0200 @@ -19,7 +19,13 @@ return ''; } - $post_ID = $block->context['postId']; + $post_ID = $block->context['postId']; + $title = get_the_title(); + + if ( ! $title ) { + return ''; + } + $tag_name = 'h2'; $align_class_name = empty( $attributes['textAlign'] ) ? '' : "has-text-align-{$attributes['textAlign']}"; @@ -27,9 +33,8 @@ $tag_name = 0 === $attributes['level'] ? 'p' : 'h' . $attributes['level']; } - $title = get_the_title( $post_ID ); if ( isset( $attributes['isLink'] ) && $attributes['isLink'] ) { - $title = sprintf( '%4s', get_the_permalink( $post_ID ), $attributes['linkTarget'], $attributes['rel'], $title ); + $title = sprintf( '%4$s', get_the_permalink( $post_ID ), esc_attr( $attributes['linkTarget'] ), esc_attr( $attributes['rel'] ), $title ); } $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $align_class_name ) );