- Timestamp:
- 07/29/2024 05:37:48 PM (12 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/html-api/class-wp-html-processor.php
r58806 r58828 610 610 * tokens works in the meantime and isn't obviously wrong. 611 611 */ 612 while( empty( $this->element_queue ) && $this->step() ) {613 continue;612 if ( empty( $this->element_queue ) && $this->step() ) { 613 return $this->next_token(); 614 614 } 615 615 … … 617 617 $this->current_element = array_shift( $this->element_queue ); 618 618 if ( ! isset( $this->current_element ) ) { 619 return false; 619 // There are no tokens left, so close all remaining open elements. 620 while ( $this->state->stack_of_open_elements->pop() ) { 621 continue; 622 } 623 624 return empty( $this->element_queue ) ? false : $this->next_token(); 620 625 } 621 626 … … 624 629 /* 625 630 * The root node only exists in the fragment parser, and closing it 626 * indicates that the parse is complete. Stop before popping i ffrom631 * indicates that the parse is complete. Stop before popping it from 627 632 * the breadcrumbs. 628 633 */ 629 634 if ( 'root-node' === $this->current_element->token->bookmark_name ) { 630 return ! $is_pop &&$this->next_token();635 return $this->next_token(); 631 636 } 632 637 … … 639 644 640 645 // Avoid sending close events for elements which don't expect a closing. 641 if ( $is_pop && ! static::expects_closer( $this->current_element->token ) ) {646 if ( $is_pop && ! $this->expects_closer( $this->current_element->token ) ) { 642 647 return $this->next_token(); 643 648 }
Note: See TracChangeset
for help on using the changeset viewer.