Interactivity API: Fatal error processing incorrect closed tags.

Fix for fatal errors caused by incorrect closing tags in HTML, such as `</br>`. 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
This commit is contained in:
luisherranz
2025-11-10 22:24:34 +00:00
parent b2d1cd8099
commit ce0770032a
2 changed files with 7 additions and 2 deletions

View File

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

View File

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