[wp-trac] [WordPress Trac] #62269: WP_HTML_Processor::next_token() cannot be extended in subclasses to keep track of state
WordPress Trac
noreply at wordpress.org
Wed Oct 23 22:03:38 UTC 2024
#62269: WP_HTML_Processor::next_token() cannot be extended in subclasses to keep
track of state
--------------------------------------+--------------------------
Reporter: westonruter | Owner: westonruter
Type: defect (bug) | Status: closed
Priority: normal | Milestone: 6.7.1
Component: HTML API | Version: 6.5
Severity: normal | Resolution: fixed
Keywords: has-unit-tests has-patch | Focuses:
--------------------------------------+--------------------------
Changes (by westonruter):
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"59285" 59285]:
{{{
#!CommitTicketReference repository="" revision="59285"
HTML API: Fix extensibility of `WP_HTML_Processor::next_token()`.
Break out logic from the `next_token()` method into a private method which
may call itself recursively. This allows for subclasses to override the
`next_token()` method and be assured that each call to `next_token()`
corresponds with the consumption of one single token. This also parallels
how `WP_HTML_Tag_Processor::next_token()` wraps a private
`base_class_next_token()` method.
Props westonruter, jonsurrell.
Fixes #62269.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/62269#comment:9>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list