Skip to content

Commit 926d491

Browse files
committed
Catch another indexing operation
1 parent ae59e1a commit 926d491

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

src/wp-includes/html-api/class-wp-html-tag-processor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1036,7 +1036,7 @@ private function parse_next_tag() {
10361036
* https://html.spec.whatwg.org/multipage/parsing.html#tag-open-state
10371037
*/
10381038
if (
1039-
strlen( $html ) > $at + 3 &&
1039+
strlen( $html ) > $at + 4 &&
10401040
'-' === $html[ $at + 2 ] &&
10411041
'-' === $html[ $at + 3 ]
10421042
) {

tests/phpunit/tests/html-api/wpHtmlTagProcessor.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1800,6 +1800,7 @@ public function test_documents_may_end_with_unclosed_comment( $html_ending_befor
18001800
*/
18011801
public function data_html_with_unclosed_comments() {
18021802
return array(
1803+
'Shortest open valid comment' => array( '<!--' ),
18031804
'Basic truncated comment' => array( '<!-- this ends --' ),
18041805
'Comment with closer look-alike' => array( '<!-- this ends --x' ),
18051806
'Comment with closer look-alike 2' => array( '<!-- this ends --!x' ),

0 commit comments

Comments
 (0)