Skip to content

Commit

Permalink
Escape class name to avoid malformed html tag (#20977)
Browse files Browse the repository at this point in the history
  • Loading branch information
talldan authored Mar 18, 2020
1 parent 14d15bf commit 46d5f4d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/block-library/src/rss/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ function render_block_core_rss( $attributes ) {
$class .= ' ' . $attributes['className'];
}

return "<ul class='{$class}'>{$list_items}</ul>";
return sprintf( "<ul class='%s'>%s</ul>", esc_attr( $class ), $list_items );
}

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/search/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function render_block_core_search( $attributes ) {

return sprintf(
'<form class="%s" role="search" method="get" action="%s">%s</form>',
$class,
esc_attr( $class ),
esc_url( home_url( '/' ) ),
$label_markup . $input_markup . $button_markup
);
Expand Down

0 comments on commit 46d5f4d

Please sign in to comment.