Skip to content

Commit

Permalink
Use a temporary bookmark to avoid modifying tag processor internal state
Browse files Browse the repository at this point in the history
  • Loading branch information
sirreal committed Nov 6, 2024
1 parent b95e402 commit 90eb6e2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/wp-includes/html-api/class-wp-html-processor.php
Original file line number Diff line number Diff line change
Expand Up @@ -5364,9 +5364,9 @@ public function seek( $bookmark_name ): bool {
$this->state->insertion_mode = WP_HTML_Processor_State::INSERTION_MODE_INITIAL;
$this->breadcrumbs = array();

$this->bytes_already_parsed = 0;
$this->parser_state = self::STATE_READY;
$this->next_token();
$this->bookmarks['initial'] = new WP_HTML_Span( 0, 0 );
parent::seek( 'initial' );
unset( $this->bookmarks['initial'] );
} else {
$this->change_parsing_namespace(
$this->context_node->integration_node_type
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/html-api/class-wp-html-tag-processor.php
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ class WP_HTML_Tag_Processor {
* @since 6.2.0
* @var int
*/
protected $bytes_already_parsed = 0;
private $bytes_already_parsed = 0;

/**
* Byte offset in input document where current token starts.
Expand Down

0 comments on commit 90eb6e2

Please sign in to comment.