Skip to content

Commit d6ca1cb

Browse files
authored
Merge pull request #336 from Ecwid/dev
PLUGINS-7030
2 parents 8669fa3 + a7ef332 commit d6ca1cb

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

includes/gutenberg/class-ecwid-gutenberg-block-store.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,9 @@ public function render_callback( $params ) {
166166

167167
if ( ! $is_profile_default ) {
168168
if ( @$attribute['type'] == 'boolean' ) {
169-
$config_js[] = 'window.ec.storefront.' . $name . '=' . ( $value === true ? 'true' : 'false' ) . ';';
169+
$config_js[] = 'window.ec.storefront.' . esc_js( $name ) . '=' . ( $value === true ? 'true' : 'false' ) . ';';
170170
} else {
171-
$config_js[] = 'window.ec.storefront.' . $name . "='" . $value . "';";
171+
$config_js[] = 'window.ec.storefront.' . esc_js( $name ) . "='" . esc_js( $value ) . "';";
172172
}
173173
$store_page_data[ $name ] = $value;
174174
}
@@ -179,7 +179,7 @@ public function render_callback( $params ) {
179179
foreach ( array( 'foreground', 'background', 'link', 'price', 'button' ) as $kind ) {
180180
$color = ( isset( $params[ 'chameleon_color_' . $kind ] ) ) ? $params[ 'chameleon_color_' . $kind ] : false;
181181
if ( $color ) {
182-
$colors[ 'color-' . $kind ] = $color;
182+
$colors[ 'color-' . esc_js( $kind ) ] = esc_js( $color );
183183
}
184184
}
185185

includes/integrations/class-ecwid-integration-gutenberg.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -287,9 +287,9 @@ public function render_callback( $params ) {
287287

288288
if ( @$attribute['is_storefront_api'] ) {
289289
if ( @$attribute['type'] == 'boolean' ) {
290-
$result .= 'window.ec.storefront.' . $name . '=' . ( $value ? 'true' : 'false' ) . ';' . PHP_EOL;
290+
$result .= 'window.ec.storefront.' . esc_js( $name ) . '=' . ( $value ? 'true' : 'false' ) . ';' . PHP_EOL;
291291
} else {
292-
$result .= 'window.ec.storefront.' . $name . "='" . $value . "';" . PHP_EOL;
292+
$result .= 'window.ec.storefront.' . esc_js( $name ) . "='" . esc_js( $value ) . "';" . PHP_EOL;
293293
}
294294
$store_page_data[ $name ] = $value;
295295
}
@@ -299,7 +299,7 @@ public function render_callback( $params ) {
299299
foreach ( array( 'foreground', 'background', 'link', 'price', 'button' ) as $kind ) {
300300
$color = @$params[ 'chameleon_color_' . $kind ];
301301
if ( $color ) {
302-
$colors[ 'color-' . $kind ] = $color;
302+
$colors[ 'color-' . esc_js( $kind ) ] = esc_js( $color );
303303
}
304304
}
305305

0 commit comments

Comments
 (0)