Skip to content

Commit

Permalink
Featured Image Block: Add missing output escaping
Browse files Browse the repository at this point in the history
  • Loading branch information
ockham committed Oct 20, 2022
1 parent 84269cf commit af09ab1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/block-library/src/post-featured-image/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function render_block_core_post_featured_image( $attributes, $content, $block )
if ( ! empty( $attributes['scale'] ) ) {
$image_styles .= "object-fit:{$attributes['scale']};";
}
$featured_image = str_replace( 'src=', 'style="' . esc_attr( $image_styles ) . '" src=', $featured_image );
$featured_image = str_replace( '<img ', '<img style="' . esc_attr( safecss_filter_attr( $image_styles ) ) . '" ', $featured_image );
}

return "<figure {$wrapper_attributes}>{$featured_image}</figure>";
Expand Down

0 comments on commit af09ab1

Please sign in to comment.