From 324f2d70b86ac0a0742610a47884dad065dc97f9 Mon Sep 17 00:00:00 2001 From: Dennis Snell Date: Fri, 2 Feb 2024 23:25:56 +0000 Subject: [PATCH] HTML API: Fix typo setting the wrong self-closing flag. The HTML Processor tracks whether a token was found with the self-closing flag. Depending on the context, this flag may or may not indicate that the element is self closing. Unfortunately it's been tracking the wrong flag: it's been tracking the end-tag flag, which indicates that a token is an end tag. In this patch the right flag is set in the HTML Processor. This hasn't been an issue because the HTML Processor doesn't yet read that stored flag, but it's an important fix to make before adding support for foreign content (SVG and MathML) since that behavior depends on reading the correct flag. Follow-up to [56274]. Props dmsnell. git-svn-id: https://develop.svn.wordpress.org/trunk@57528 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/html-api/class-wp-html-processor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/html-api/class-wp-html-processor.php b/src/wp-includes/html-api/class-wp-html-processor.php index 6b0879cde8..dd8e8d5f2d 100644 --- a/src/wp-includes/html-api/class-wp-html-processor.php +++ b/src/wp-includes/html-api/class-wp-html-processor.php @@ -548,7 +548,7 @@ class WP_HTML_Processor extends WP_HTML_Tag_Processor { $this->state->current_token = new WP_HTML_Token( $this->bookmark_tag(), $this->get_tag(), - $this->is_tag_closer(), + $this->has_self_closing_flag(), $this->release_internal_bookmark_on_destruct );