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.
Built from https://develop.svn.wordpress.org/trunk@57340


git-svn-id: http://core.svn.wordpress.org/trunk@56846 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
youknowriad 2024-01-23 17:11:11 +00:00
parent 97518917dd
commit 7343352744
2 changed files with 2 additions and 1 deletions

View File

@ -1070,6 +1070,7 @@ class WP_Theme_JSON {
foreach ( $style_nodes as &$node ) {
$node['selector'] = static::scope_selector( $options['scope'], $node['selector'] );
}
unset( $node );
}
if ( ! empty( $options['root_selector'] ) ) {

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.5-alpha-57339';
$wp_version = '6.5-alpha-57340';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.