Skip to content

Commit 9430d6a

Browse files
committed
HTML API: Truncated funky comments should cause the Tag Processor to pause.
A state change was missing in the Tag Processor when the input is too short to find a comment closer after an opened funky comment. This patch fixes a issue where `</#` does not correctly report incomplete input, but `</# ` does. Developed in WordPress/wordpress-develop#7146 Discussed in https://core.trac.wordpress.org/ticket/61831 Props: jonsurrell. Fixes #61831. Built from https://develop.svn.wordpress.org/trunk@58858 git-svn-id: https://core.svn.wordpress.org/trunk@58254 1a063a9b-81f0-0310-95a4-ce76da25c4cd
1 parent c19a02c commit 9430d6a

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1909,6 +1909,8 @@ private function parse_next_tag(): bool {
19091909
if ( $this->is_closing_tag ) {
19101910
// No chance of finding a closer.
19111911
if ( $at + 3 > $doc_length ) {
1912+
$this->parser_state = self::STATE_INCOMPLETE_INPUT;
1913+
19121914
return false;
19131915
}
19141916

wp-includes/version.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* @global string $wp_version
1818
*/
19-
$wp_version = '6.7-alpha-58857';
19+
$wp_version = '6.7-alpha-58858';
2020

2121
/**
2222
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

0 commit comments

Comments
 (0)