Make WordPress Core


Ignore:
Timestamp:
11/22/2024 12:50:48 PM (14 months ago)
Author:
cbravobernal
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/html-api/class-wp-html-processor.php

    r59444 r59450  
    465465     */
    466466    public function create_fragment_at_current_node( string $html ) {
    467         if ( $this->get_token_type() !== '#tag' ) {
     467        if ( $this->get_token_type() !== '#tag' || $this->is_tag_closer() ) {
    468468            return null;
    469469        }
Note: See TracChangeset for help on using the changeset viewer.