Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Small tweaks based on feedback
  • Loading branch information
andrewserong committed Jan 3, 2023
commit 1df41be19dc9bcedd419c52b3899c57e76145268
2 changes: 1 addition & 1 deletion src/wp-includes/class-wp-theme-json.php
Original file line number Diff line number Diff line change
Expand Up @@ -2788,7 +2788,7 @@ protected static function remove_insecure_styles( $input ) {
foreach ( static::INDIRECT_PROPERTIES_METADATA as $property => $path ) {
$value = _wp_array_get( $input, $path, array() );
if (
isset( $value ) &&
null !== $value &&
! is_array( $value ) &&
static::is_safe_css_declaration( $property, $value )
) {
Expand Down
18 changes: 9 additions & 9 deletions tests/phpunit/tests/theme/wpThemeJson.php
Original file line number Diff line number Diff line change
Expand Up @@ -2394,43 +2394,43 @@ public function test_remove_insecure_properties_should_allow_indirect_properties
array(
'version' => WP_Theme_JSON::LATEST_SCHEMA,
'styles' => array(
'spacing' => array(
'blockGap' => '3em',
),
'blocks' => array(
'core/social-links' => array(
'spacing' => array(
'blockGap' => array(
'top' => '1em',
'left' => '2em',
'top' => '1em',
),
),
),
),
'spacing' => array(
'blockGap' => '3em',
),
),
)
);

$expected = array(
'version' => WP_Theme_JSON::LATEST_SCHEMA,
'styles' => array(
'spacing' => array(
'blockGap' => '3em',
),
'blocks' => array(
'core/social-links' => array(
'spacing' => array(
'blockGap' => array(
'top' => '1em',
'left' => '2em',
'top' => '1em',
),
),
),
),
'spacing' => array(
'blockGap' => '3em',
),
),
);

$this->assertEqualSetsWithIndex( $expected, $actual );
$this->assertSameSetsWithIndex( $expected, $actual );
}

/**
Expand Down