Skip to content

Commit

Permalink
Improve image block lightbox escaping (#51061)
Browse files Browse the repository at this point in the history
* Improve the image block lightbox escaping.
  • Loading branch information
juanfra authored May 29, 2023
1 parent 62f2353 commit 1ac78cc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/block-library/src/image/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ function render_block_core_image( $attributes, $content ) {
'</div>';
$body_content = preg_replace( '/<img[^>]+>/', $button, $content );

$background_color = wp_get_global_styles( array( 'color', 'background' ) );
$background_color = esc_attr( wp_get_global_styles( array( 'color', 'background' ) ) );
$close_button_icon = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="30" height="30" aria-hidden="true" focusable="false"><path d="M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"></path></svg>';

$dialog_label = $alt_attribute ? $alt_attribute : __( 'Image' );
$dialog_label = $alt_attribute ? esc_attr( $alt_attribute ) : esc_attr__( 'Image' );

$close_button_label = __( 'Close' );
$close_button_label = esc_attr__( 'Close' );

return
<<<HTML
Expand Down

1 comment on commit 1ac78cc

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in 1ac78cc.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5114157888
📝 Reported issues:

Please sign in to comment.