[wp-trac] [WordPress Trac] #58160: HTML API: Fix case where updates are overlooked when seeking to earlier locations.
WordPress Trac
noreply at wordpress.org
Wed Apr 19 21:51:07 UTC 2023
#58160: HTML API: Fix case where updates are overlooked when seeking to earlier
locations.
--------------------------+----------------------------------------
Reporter: dmsnell | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: HTML API | Version: 6.2
Severity: normal | Keywords: has-patch needs-unit-tests
Focuses: |
--------------------------+----------------------------------------
[https://github.com/WordPress/wordpress-develop/pull/4345 GitHub PR#4345]
In certain cases when seeking to an earlier location in a document after
changes have been enqueued, the tag processor will lose the earlier
changes.
In this patch we're fixing the bug so that it properly retains the changes
that were applied before the call to seek().
The problem was that when changes had already been applied and no more
were enqueued, the tag processor was returning the updated HTML without
updating its internal state to reflect that. This was probably an
optimization for that case but I can't remember exactly why it doesn't
update the internal pointers (@adamziel maybe you remember?). The fix is
simple: mirror the second case and update the internal pointers.
cc: @ockham
--
Ticket URL: <https://core.trac.wordpress.org/ticket/58160>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list