Skip to content

Commit

Permalink
Escape the icon href attribute (#2594)
Browse files Browse the repository at this point in the history
  • Loading branch information
EvanHerman authored Mar 11, 2024
1 parent a8f5f89 commit 2622dc1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/blocks/icon/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ function coblocks_render_coblocks_icon_block( $attrs ) {
if ( ! empty( $attrs['href'] ) ) {
$icon = sprintf(
'<a href="%1$s" rel="%2$s" target="%3$s" style="%4$s">%5$s</a>',
$attrs['href'],
esc_url( $attrs['href'] ),
! empty( $attrs['rel'] ) ? esc_attr( $attrs['rel'] ) : '',
! empty( $attrs['linkTarget'] ) ? esc_attr( $attrs['linkTarget'] ) : '_self',
esc_attr( $color_styles ), // To make sure the color gets to the svg when there is an anchor.
Expand Down

0 comments on commit 2622dc1

Please sign in to comment.