Make WordPress Core

Opened 3 weeks ago

Closed 3 weeks ago

Last modified 3 weeks ago

#60428 closed defect (bug) (fixed)

HTML API: Reset parser state after seeking to bookmark.

Reported by: dmsnell's profile dmsnell Owned by: dmsnell's profile dmsnell
Milestone: 6.5 Priority: normal
Severity: normal Version: trunk
Component: HTML API Keywords: has-patch has-unit-tests
Focuses: Cc:

Description

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 get's properly adjusted on the successive call to next_token().

Follow-up to [57211]

Props dmsnell, kevin940726

Change History (4)

#1 @dmsnell
3 weeks ago

  • Keywords has-patch needs-unit-tests added
  • Milestone changed from Awaiting Review to 6.5

This ticket was mentioned in PR #6021 on WordPress/wordpress-develop by @dmsnell.


3 weeks ago
#2

  • Keywords has-unit-tests added; needs-unit-tests removed

Trac ticket: Core-60428

When parser states were introduced in WordPress/wordpress-develop#5725, 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 get's properly adjusted on the successive call to next_token().

Follows [57211]
See Trac ticket 60170

Props @kevin940726 for finding and reporting.

#3 @dmsnell
3 weeks ago

  • Owner set to dmsnell
  • Resolution set to fixed
  • Status changed from new to closed

In 57527:

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 https://github.com/WordPress/wordpress-develop/pull/6021
Discussed in https://core.trac.wordpress.org/ticket/60428

Follow-up to [57211]

Props dmsnell, kevin940726
Fixes #60428

Note: See TracTickets for help on using tickets.