From 80320e25ba224329b3f556f1d3e5e61d4a34ba89 Mon Sep 17 00:00:00 2001 From: chad1008 <13856531+chad1008@users.noreply.github.com> Date: Thu, 12 May 2022 09:47:00 -0400 Subject: [PATCH] check inline CSS rules for semicolons before adding them to inline styles --- packages/style-engine/class-wp-style-engine.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/style-engine/class-wp-style-engine.php b/packages/style-engine/class-wp-style-engine.php index 5687a2f422186e..4b06bcd653fd0c 100644 --- a/packages/style-engine/class-wp-style-engine.php +++ b/packages/style-engine/class-wp-style-engine.php @@ -242,7 +242,8 @@ public function generate( $block_styles ) { foreach ( $css_rules as $rule => $value ) { $filtered_css = esc_html( safecss_filter_attr( "{$rule}: {$value}" ) ); if ( ! empty( $filtered_css ) ) { - $css_output .= $filtered_css . '; '; + $css_output_suffix = str_ends_with( $filtered_css, ';' ) ? ' ' : '; '; + $css_output .= $filtered_css . $css_output_suffix; } } }