From ce0770032a8ff253ef9ee4d80e89bb0c97eb4bb4 Mon Sep 17 00:00:00 2001 From: luisherranz Date: Mon, 10 Nov 2025 22:24:34 +0000 Subject: [PATCH] Interactivity API: Fatal error processing incorrect closed tags. Fix for fatal errors caused by incorrect closing tags in HTML, such as `
`. In these cases, the `get_attribute_names_with_prefix` method of the `WP_HTML_Tag_Processor` returns `null`, and the Interactivity API was not handling this situation correctly. Props hugosolar, jonsurrell, darerodz. Fixes #63891. Built from https://develop.svn.wordpress.org/trunk@61197 git-svn-id: http://core.svn.wordpress.org/trunk@60533 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- .../interactivity-api/class-wp-interactivity-api.php | 7 ++++++- wp-includes/version.php | 2 +- 2 files changed, 7 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 1763142167..539242e211 100644 --- a/wp-includes/interactivity-api/class-wp-interactivity-api.php +++ b/wp-includes/interactivity-api/class-wp-interactivity-api.php @@ -520,7 +520,12 @@ final class WP_Interactivity_API { array_pop( $tag_stack ); } } else { - if ( 0 !== count( $p->get_attribute_names_with_prefix( 'data-wp-each-child' ) ) ) { + $each_child_attrs = $p->get_attribute_names_with_prefix( 'data-wp-each-child' ); + if ( null === $each_child_attrs ) { + continue; + } + + if ( 0 !== count( $each_child_attrs ) ) { /* * If the tag has a `data-wp-each-child` directive, jump to its closer * tag because those tags have already been processed. diff --git a/wp-includes/version.php b/wp-includes/version.php index a29c33c1ec..ddf292a5d5 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.9-beta4-61196'; +$wp_version = '6.9-beta4-61197'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.