Skip to content

Commit ace2a50

Browse files
added doc comment and changed description
1 parent d64f1dc commit ace2a50

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/plugins/theme-block-style-inheritance/index.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,13 +310,24 @@ function add_body_class_block_style_inheritance( $classes ) {
310310
/**
311311
* Some themes uses color-mix in their theme.json file.
312312
* This allows us to inherit the styles that uses color-mix.
313+
*
314+
* Below is the identical test performed in wp-includes/kses.php:2659
315+
* @see wp-includes/kses.php
313316
*/
314317
function allow_css( $allow_css, $css_test_string ) {
318+
/**
319+
* Allow CSS functions like color-mix(). by removing them from the test string.
320+
* Nested functions and parentheses are also removed, so long as the parentheses are balanced.
321+
*/
315322
$css_test_string = preg_replace(
316323
'/\b(?:color-mix)(\((?:[^()]|(?1))*\))/',
317324
'',
318325
$css_test_string
319326
);
327+
/*
328+
* Disallow CSS containing \ ( & } = or comments, except for within url(), var(), calc(), etc.
329+
* which were removed from the test string above.
330+
*/
320331
$allow_css = ! preg_match( '%[\\\(&=}]|/\*%', $css_test_string );
321332
return $allow_css;
322333
}

src/welcome/admin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1422,7 +1422,7 @@ const AdditionalOptions = props => {
14221422
<CheckboxControl
14231423
label={ __( 'Inherit Block Styles from theme.json', i18n ) }
14241424
className={ searchClassname( __( 'Inherit Block Styles from theme.json', i18n ), miscellaneous ) }
1425-
help={ __( `When enabled, Stackable blocks will inherit styles from the theme.json file.`, i18n ) }
1425+
help={ __( `When enabled, Stackable blocks will inherit styles from the theme.json file of your Block Theme.`, i18n ) }
14261426
checked={ ! settings.stackable_disable_block_style_inheritance }
14271427
onChange={ checked => {
14281428
handleSettingsChange( { stackable_disable_block_style_inheritance: ! checked } ) // eslint-disable-line camelcase

0 commit comments

Comments
 (0)