Skip to content

Commit

Permalink
Template Part: Improve how the tag name attribute is handled (#62785)
Browse files Browse the repository at this point in the history
Only valid tags should be allowed rather than characters that can't be a part of HTML tags.

Co-authored-by: gziolo <[email protected]>
Co-authored-by: aaronjorbin <[email protected]>
  • Loading branch information
3 people authored Jun 24, 2024
1 parent d0d775b commit abe0925
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/block-library/src/template-part/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ function render_block_core_template_part( $attributes ) {
global $wp_embed;
$content = $wp_embed->autoembed( $content );

if ( empty( $attributes['tagName'] ) ) {
if ( empty( $attributes['tagName'] ) || tag_escape( $attributes['tagName'] ) !== $attributes['tagName'] ) {
$area_tag = 'div';
if ( $area_definition && isset( $area_definition['area_tag'] ) ) {
$area_tag = $area_definition['area_tag'];
Expand Down

0 comments on commit abe0925

Please sign in to comment.