From 261373653c190d4c77a677f9df75f40a89c4648e Mon Sep 17 00:00:00 2001 From: cbravobernal Date: Fri, 22 Nov 2024 12:52:19 +0000 Subject: [PATCH] HTML API: Prevent fragment creation on close tag. Prevent fragments from being created at tag closers. Follow-up to [59444]. Props jonsurrell, bernhard-reiter. Fixes #62357. Built from https://develop.svn.wordpress.org/trunk@59450 git-svn-id: http://core.svn.wordpress.org/trunk@58836 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/html-api/class-wp-html-processor.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/html-api/class-wp-html-processor.php b/wp-includes/html-api/class-wp-html-processor.php index 39196499fa..4bdb75fcac 100644 --- a/wp-includes/html-api/class-wp-html-processor.php +++ b/wp-includes/html-api/class-wp-html-processor.php @@ -464,7 +464,7 @@ class WP_HTML_Processor extends WP_HTML_Tag_Processor { * @return static|null The created processor if successful, otherwise null. */ public function create_fragment_at_current_node( string $html ) { - if ( $this->get_token_type() !== '#tag' ) { + if ( $this->get_token_type() !== '#tag' || $this->is_tag_closer() ) { return null; } diff --git a/wp-includes/version.php b/wp-includes/version.php index 0aee31198d..2d926d0b9c 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.8-alpha-59449'; +$wp_version = '6.8-alpha-59450'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.