From b47546f8b01a4e6770148d5ee623a91bcfbdf8d5 Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Mon, 15 Sep 2025 12:59:35 +0000 Subject: [PATCH] Interactivity API: Fix "Cannot use bool as array" error. Improves PHP 8.5 compatibility where calling `list()` on an empty array throws a warning. Props swissspidy, jonsurrell, mukesh27. Fixes #63977. See #63061. Built from https://develop.svn.wordpress.org/trunk@60741 git-svn-id: http://core.svn.wordpress.org/trunk@60077 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/interactivity-api/class-wp-interactivity-api.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/interactivity-api/class-wp-interactivity-api.php b/wp-includes/interactivity-api/class-wp-interactivity-api.php index fdde5d429a..0495af5f85 100644 --- a/wp-includes/interactivity-api/class-wp-interactivity-api.php +++ b/wp-includes/interactivity-api/class-wp-interactivity-api.php @@ -423,7 +423,7 @@ final class WP_Interactivity_API { } if ( $p->is_tag_closer() ) { - list( $opening_tag_name, $directives_prefixes ) = end( $tag_stack ); + list( $opening_tag_name, $directives_prefixes ) = ! empty( $tag_stack ) ? end( $tag_stack ) : array( null, null ); if ( 0 === count( $tag_stack ) || $opening_tag_name !== $tag_name ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index 5a04f7ed45..cbd9c3b23f 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.9-alpha-60740'; +$wp_version = '6.9-alpha-60741'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.