From 86591014915cda77fbb88ac70694c051c0b8b0f3 Mon Sep 17 00:00:00 2001 From: zieladam Date: Fri, 21 Apr 2023 13:32:25 +0000 Subject: [PATCH] HTML API: Fix a case where updates are overlooked when seeking to earlier locations. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This retains the WP_HTML_Tag_Processor attribute updates applied before calling seek() – they were erroneously erased in some cases. Props dmsnell. Fixes #58160. Built from https://develop.svn.wordpress.org/trunk@55675 git-svn-id: http://core.svn.wordpress.org/trunk@55187 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/html-api/class-wp-html-tag-processor.php | 2 ++ wp-includes/version.php | 2 +- 2 files changed, 3 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 039a8f275b..8c41e73215 100644 --- a/wp-includes/html-api/class-wp-html-tag-processor.php +++ b/wp-includes/html-api/class-wp-html-tag-processor.php @@ -2142,6 +2142,8 @@ class WP_HTML_Tag_Processor { * to the end of the updated document and return. */ if ( $requires_no_updating && $this->bytes_already_copied > 0 ) { + $this->html = $this->output_buffer . substr( $this->html, $this->bytes_already_copied ); + $this->bytes_already_copied = strlen( $this->output_buffer ); return $this->output_buffer . substr( $this->html, $this->bytes_already_copied ); } diff --git a/wp-includes/version.php b/wp-includes/version.php index 747e8c2ada..4bd41c3146 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.3-alpha-55674'; +$wp_version = '6.3-alpha-55675'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.