diff --git a/src/wp-includes/html-api/class-wp-html-tag-processor.php b/src/wp-includes/html-api/class-wp-html-tag-processor.php
index fe8a20c1ea4ee..e41e1120550b5 100644
--- a/src/wp-includes/html-api/class-wp-html-tag-processor.php
+++ b/src/wp-includes/html-api/class-wp-html-tag-processor.php
@@ -1619,7 +1619,6 @@ private function skip_script_data(): bool {
( 'p' === $html[ $at + 4 ] || 'P' === $html[ $at + 4 ] ) &&
( 't' === $html[ $at + 5 ] || 'T' === $html[ $at + 5 ] )
) ) {
- ++$at;
continue;
}
diff --git a/tests/phpunit/tests/html-api/wpHtmlTagProcessor.php b/tests/phpunit/tests/html-api/wpHtmlTagProcessor.php
index a066543d8e11f..fd73ddc43a4ba 100644
--- a/tests/phpunit/tests/html-api/wpHtmlTagProcessor.php
+++ b/tests/phpunit/tests/html-api/wpHtmlTagProcessor.php
@@ -2116,6 +2116,8 @@ public static function data_script_tag(): Generator {
yield 'Script tag with close' => array( "", true );
yield 'Script tag with close' => array( "", true );
yield 'Script with type attribute' => array( '', true );
+ yield 'Script text less-than' => array( '', true );
+ yield 'Script text less-than solidus' => array( '', true );
yield 'Script data escaped' => array( '', true );
yield 'Script data double-escaped exit (comment)' => array( '', true );
yield 'Script data double-escaped exit (closed ">")' => array( '', true );