HTML API: Stop counting no-op seek operations against the max seek count.

This allows `seek()` to be freely called when the current cursor at the provided bookmark.

Props dmsnell, jonsurrell, westonruter.
Fixes #62085.

Built from https://develop.svn.wordpress.org/trunk@59812


git-svn-id: http://core.svn.wordpress.org/trunk@59154 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Weston Ruter 2025-02-11 20:04:23 +00:00
parent 5f79466650
commit 08c4498647
2 changed files with 10 additions and 1 deletions

View File

@ -2551,6 +2551,15 @@ class WP_HTML_Tag_Processor {
return false;
}
$existing_bookmark = $this->bookmarks[ $bookmark_name ];
if (
$this->token_starts_at === $existing_bookmark->start &&
$this->token_length === $existing_bookmark->length
) {
return true;
}
if ( ++$this->seek_count > static::MAX_SEEK_OPS ) {
_doing_it_wrong(
__METHOD__,

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.8-alpha-59809';
$wp_version = '6.8-alpha-59812';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.