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
This commit is contained in:
cbravobernal 2024-11-22 12:52:19 +00:00
parent e0d58b3987
commit 261373653c
2 changed files with 2 additions and 2 deletions

View File

@ -464,7 +464,7 @@ class WP_HTML_Processor extends WP_HTML_Tag_Processor {
* @return static|null The created processor if successful, otherwise null. * @return static|null The created processor if successful, otherwise null.
*/ */
public function create_fragment_at_current_node( string $html ) { 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; return null;
} }

View File

@ -16,7 +16,7 @@
* *
* @global string $wp_version * @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. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.