From 73433527445fa730f508d2bc5f360dd4f07344d9 Mon Sep 17 00:00:00 2001 From: youknowriad Date: Tue, 23 Jan 2024 17:11:11 +0000 Subject: [PATCH] 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 --- wp-includes/class-wp-theme-json.php | 1 + wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/wp-includes/class-wp-theme-json.php b/wp-includes/class-wp-theme-json.php index 37f4d11ce9..4094e11524 100644 --- a/wp-includes/class-wp-theme-json.php +++ b/wp-includes/class-wp-theme-json.php @@ -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'] ) ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index 18d8cb6360..2d38dd4a82 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -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.