From d7f9d30df8e0ec9cf37eb9eab03c7356d9f31e98 Mon Sep 17 00:00:00 2001 From: dmsnell Date: Mon, 2 Sep 2024 21:54:15 +0000 Subject: [PATCH] HTML API: Fix logic bug in HTML Processor when opening A element. A mistake in the original code handling opening A elements in the HTML Processor led to mistakes in parsing where the Processor would bail in situations when it could have proceeded. While this was errant behavior, it didn't violate the public contract since it would bail in these situations. This patch fixes the mistake, which was to only break out of the innermost loop instead of breaking from the containing loop, which resolves the issue. Developed in https://github.com/WordPress/wordpress-develop/pull/7281 Discussed in https://core.trac.wordpress.org/ticket/61576 Follow-up to [56274]. Props jonsurrell. See #61576. Built from https://develop.svn.wordpress.org/trunk@58966 git-svn-id: http://core.svn.wordpress.org/trunk@58362 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 d6df280f35..7c47198142 100644 --- a/wp-includes/html-api/class-wp-html-processor.php +++ b/wp-includes/html-api/class-wp-html-processor.php @@ -2352,13 +2352,13 @@ class WP_HTML_Processor extends WP_HTML_Tag_Processor { foreach ( $this->state->active_formatting_elements->walk_up() as $item ) { switch ( $item->node_name ) { case 'marker': - break; + break 2; case 'A': $this->run_adoption_agency_algorithm(); $this->state->active_formatting_elements->remove_node( $item ); $this->state->stack_of_open_elements->remove_node( $item ); - break; + break 2; } } diff --git a/wp-includes/version.php b/wp-includes/version.php index 0f9418335b..e81ad0dced 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.7-alpha-58965'; +$wp_version = '6.7-alpha-58966'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.