From 08c44986476c250e1d2bb1d7a8e17f7b26264150 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Tue, 11 Feb 2025 20:04:23 +0000 Subject: [PATCH] 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 --- wp-includes/html-api/class-wp-html-tag-processor.php | 9 +++++++++ wp-includes/version.php | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/wp-includes/html-api/class-wp-html-tag-processor.php b/wp-includes/html-api/class-wp-html-tag-processor.php index 39390621e8..032ca2af32 100644 --- a/wp-includes/html-api/class-wp-html-tag-processor.php +++ b/wp-includes/html-api/class-wp-html-tag-processor.php @@ -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__, diff --git a/wp-includes/version.php b/wp-includes/version.php index 997e5e649d..01550add5b 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -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.