Commit c20224b
dmsnell
HTML API: Only stop on full matches for requested tag name.
An optimization pass on the HTML API left a bug in the `matches()`
method, whereby it would falsely detect a tag name match if the
found tag were a lexical subset of the requested tag. This occurred
because of the use of `substr_compare()` without checking that the
outer lengths matched.
This patch resolves the bug by adding the length check.
Developed in #7189
Discussed in https://core.trac.wordpress.org/ticket/61545
Follow-up to [58613].
Props dmsnell, westonruter.
See #61545.
git-svn-id: https://develop.svn.wordpress.org/trunk@58893 602fd350-edb4-49c9-b593-d223f7449a821 parent 7bf4947 commit c20224b
File tree
2 files changed
+32
-1
lines changed- src/wp-includes/html-api
- tests/phpunit/tests/html-api
2 files changed
+32
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4009 | 4009 | | |
4010 | 4010 | | |
4011 | 4011 | | |
4012 | | - | |
| 4012 | + | |
| 4013 | + | |
| 4014 | + | |
| 4015 | + | |
| 4016 | + | |
| 4017 | + | |
| 4018 | + | |
4013 | 4019 | | |
4014 | 4020 | | |
4015 | 4021 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
601 | 601 | | |
602 | 602 | | |
603 | 603 | | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
604 | 629 | | |
605 | 630 | | |
606 | 631 | | |
| |||
0 commit comments