Make WordPress Core


Ignore:
Timestamp:
11/10/2025 10:22:18 PM (3 months ago)
Author:
luisherranz
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/interactivity-api/class-wp-interactivity-api.php

    r61020 r61197  
    521521                }
    522522            } else {
    523                 if ( 0 !== count( $p->get_attribute_names_with_prefix( 'data-wp-each-child' ) ) ) {
     523                $each_child_attrs = $p->get_attribute_names_with_prefix( 'data-wp-each-child' );
     524                if ( null === $each_child_attrs ) {
     525                    continue;
     526                }
     527
     528                if ( 0 !== count( $each_child_attrs ) ) {
    524529                    /*
    525530                     * If the tag has a `data-wp-each-child` directive, jump to its closer
Note: See TracChangeset for help on using the changeset viewer.