Skip to content

Commit

Permalink
Small tweaks based on feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewserong committed Dec 13, 2022
1 parent 8fa5d48 commit 64c4621
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
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 @@ -2774,7 +2774,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

0 comments on commit 64c4621

Please sign in to comment.