Skip to content

Commit

Permalink
Escape border radius css property name
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronrobertshaw committed Jun 30, 2021
1 parent dc94737 commit b040c8a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/block-library/src/search/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,14 +201,18 @@ function styles_for_block_core_search( $attributes ) {
$name = strtolower( preg_replace( '/(?<!^)[A-Z]/', '-$0', $key ) );

// Add shared styles for individual border radii for input & button.
$shared_styles[] = sprintf( 'border-%s-radius: %s;', $name, esc_attr( $value ) );
$shared_styles[] = sprintf(
'border-%s-radius: %s;',
esc_attr( $name ),
esc_attr( $value )
);

// Add adjusted border radius styles for the wrapper element
// if button is positioned inside.
if ( $button_inside && intval( $value ) !== 0 ) {
$wrapper_styles[] = sprintf(
'border-%s-radius: calc(%s + %s);',
$name,
esc_attr( $name ),
esc_attr( $value ),
$default_padding
);
Expand Down

0 comments on commit b040c8a

Please sign in to comment.