Skip to content

Commit a21e447

Browse files
committed
Editor: Unset reference used in foreach statement.
In PHP it is a good practice to unset $value if it was created by reference in a foreach loop, as the reference is still valid outside the loop, and this avoids accidental bugs. Props get_dave. Fixes #60326. git-svn-id: https://develop.svn.wordpress.org/trunk@57340 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 2f91b1f commit a21e447

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/wp-includes/class-wp-theme-json.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,6 +1070,7 @@ public function get_stylesheet( $types = array( 'variables', 'styles', 'presets'
10701070
foreach ( $style_nodes as &$node ) {
10711071
$node['selector'] = static::scope_selector( $options['scope'], $node['selector'] );
10721072
}
1073+
unset( $node );
10731074
}
10741075

10751076
if ( ! empty( $options['root_selector'] ) ) {

0 commit comments

Comments
 (0)