mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-16 19:46:21 +00:00
Editor: Check for null values in Theme JSON to cater for blockGap.
When resolving theme.json preset variables, add a check to make sure the value is not empty before we run it through strpos() and preg_match_all(). Props ramonopoly, mukesh27, get_dave. Fixes #60613. Built from https://develop.svn.wordpress.org/trunk@57716 git-svn-id: http://core.svn.wordpress.org/trunk@57217 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
f274631e5c
commit
9f0595ab4a
@ -3857,12 +3857,18 @@ class WP_Theme_JSON {
|
|||||||
* Replaces CSS variables with their values in place.
|
* Replaces CSS variables with their values in place.
|
||||||
*
|
*
|
||||||
* @since 6.3.0
|
* @since 6.3.0
|
||||||
|
* @since 6.5.0 Check for empty style before processing its value.
|
||||||
|
*
|
||||||
* @param array $styles CSS declarations to convert.
|
* @param array $styles CSS declarations to convert.
|
||||||
* @param array $values key => value pairs to use for replacement.
|
* @param array $values key => value pairs to use for replacement.
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
private static function convert_variables_to_value( $styles, $values ) {
|
private static function convert_variables_to_value( $styles, $values ) {
|
||||||
foreach ( $styles as $key => $style ) {
|
foreach ( $styles as $key => $style ) {
|
||||||
|
if ( empty( $style ) ) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if ( is_array( $style ) ) {
|
if ( is_array( $style ) ) {
|
||||||
$styles[ $key ] = self::convert_variables_to_value( $style, $values );
|
$styles[ $key ] = self::convert_variables_to_value( $style, $values );
|
||||||
continue;
|
continue;
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '6.5-beta2-57715';
|
$wp_version = '6.5-beta2-57716';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user