mirror of
git://develop.git.wordpress.org/
synced 2025-02-11 18:41:37 +01:00
HTML API: Respect tag_name
query arg in HTML_Processor::next_tag()
Previously the HTML Processor was ignoring the `tag_name` argument in the `next_tag()` query if it existed. This was wrong adn would lead to calling code finding the very next tag, regardless of tag name, instead of the requested taag. This patch adds the tag name detection code into `next_tag()` to fix the bug and ensure that `next_tag()` always returns only when finding a tag of the given name. Developed in https://github.com/WordPress/wordpress-develop/pull/6980 Discussed in https://core.trac.wordpress.org/ticket/61581 Follow-up to [56274]. Fixes #61581. git-svn-id: https://develop.svn.wordpress.org/trunk@58681 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
ce10b4c75c
commit
f90c8bf1ae
@ -466,6 +466,10 @@ class WP_HTML_Processor extends WP_HTML_Tag_Processor {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( isset( $query['tag_name'] ) && $query['tag_name'] !== $this->get_token_name() ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( isset( $needs_class ) && ! $this->has_class( $needs_class ) ) {
|
||||
continue;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user