Skip to content

Commit 22b4a08

Browse files
committed
HTML API: Reset parser state after seeking to bookmark.
When parser states were introduced, nothing in the `seek()` method reset the parser state. This is problematic because it could leave the parser in the wrong state. In this patch the parser state is reset so that it's properly adjusted on the successive call to `next_token()`. Developed in WordPress/wordpress-develop#6021 Discussed in https://core.trac.wordpress.org/ticket/60428 Follow-up to [57211] Props dmsnell, kevin940726 Fixes #60428 Built from https://develop.svn.wordpress.org/trunk@57527 git-svn-id: http://core.svn.wordpress.org/trunk@57028 1a063a9b-81f0-0310-95a4-ce76da25c4cd
1 parent 742e8aa commit 22b4a08

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

wp-includes/html-api/class-wp-html-tag-processor.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2335,6 +2335,7 @@ public function seek( $bookmark_name ) {
23352335

23362336
// Point this tag processor before the sought tag opener and consume it.
23372337
$this->bytes_already_parsed = $this->bookmarks[ $bookmark_name ]->start;
2338+
$this->parser_state = self::STATE_READY;
23382339
return $this->next_token();
23392340
}
23402341

wp-includes/version.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* @global string $wp_version
1818
*/
19-
$wp_version = '6.5-alpha-57526';
19+
$wp_version = '6.5-alpha-57527';
2020

2121
/**
2222
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

0 commit comments

Comments
 (0)