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
This commit is contained in:
Pascal Birchler
2025-09-15 12:59:35 +00:00
parent 5db5ede87e
commit b47546f8b0
2 changed files with 2 additions and 2 deletions

View File

@@ -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 ) {

View File

@@ -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.