From 85092d6493b57e2d071d8d265f01fe88d440b34b Mon Sep 17 00:00:00 2001 From: dmsnell Date: Tue, 9 Jul 2024 21:45:17 +0000 Subject: [PATCH] HTML API: Correct node name in `generate_implied_end_tags()`. The `generate_implied_end_tags()` algorithm has been comparing the current node to a list of node names, which means that it won't ever pop any elements from the stack of open elements. This patch corrects the mistake by comparing node name against the list, thus fixing the algorithm. This was noted in development work for the 6.7 release. Developed in https://github.com/WordPress/wordpress-develop/pull/6988 Discussed in https://core.trac.wordpress.org/ticket/61576 Props dmsnell, jonsurrell. See #61576. Built from https://develop.svn.wordpress.org/trunk@58702 git-svn-id: http://core.svn.wordpress.org/trunk@58104 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/html-api/class-wp-html-processor.php | 4 ++-- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-includes/html-api/class-wp-html-processor.php b/wp-includes/html-api/class-wp-html-processor.php index 588d2fbe7d..223fcda76a 100644 --- a/wp-includes/html-api/class-wp-html-processor.php +++ b/wp-includes/html-api/class-wp-html-processor.php @@ -2771,7 +2771,7 @@ class WP_HTML_Processor extends WP_HTML_Tag_Processor { while ( ( $no_exclusions || ! $this->state->stack_of_open_elements->current_node_is( $except_for_this_element ) ) && - in_array( $this->state->stack_of_open_elements->current_node(), $elements_with_implied_end_tags, true ) + in_array( $this->state->stack_of_open_elements->current_node()->node_name, $elements_with_implied_end_tags, true ) ) { $this->state->stack_of_open_elements->pop(); } @@ -2811,7 +2811,7 @@ class WP_HTML_Processor extends WP_HTML_Tag_Processor { 'TR', ); - while ( in_array( $this->state->stack_of_open_elements->current_node(), $elements_with_implied_end_tags, true ) ) { + while ( in_array( $this->state->stack_of_open_elements->current_node()->node_name, $elements_with_implied_end_tags, true ) ) { $this->state->stack_of_open_elements->pop(); } } diff --git a/wp-includes/version.php b/wp-includes/version.php index 384897b2ef..eb8deaade7 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.7-alpha-58694'; +$wp_version = '6.7-alpha-58702'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.