Skip to content

Commit c98f64d

Browse files
committed
Add test case for infinite loop in skip_script_data
1 parent a799101 commit c98f64d

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2875,4 +2875,18 @@ public function insert_after( $new_html ) {
28752875
'Should have properly applied the update from in front of the cursor.'
28762876
);
28772877
}
2878+
2879+
/**
2880+
* Test an infinite loop bugfix in script tag processing.
2881+
*
2882+
* @small
2883+
*
2884+
* @ticket TBD
2885+
*/
2886+
public function test_script_tag_processing_no_infinite_loop() {
2887+
$processor = new WP_HTML_Tag_Processor( '<script type="data">-' );
2888+
2889+
$this->assertFalse( $processor->next_tag() );
2890+
$this->assertTrue( $processor->paused_at_incomplete_token() );
2891+
}
28782892
}

0 commit comments

Comments
 (0)