File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
tests/phpunit/tests/html-api Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -1176,4 +1176,22 @@ public function test_multiple_duplicate_attributes_removed() {
11761176 );
11771177 $ this ->assertEqualHTML ( '<input type="text"> ' , $ result );
11781178 }
1179+
1180+ /**
1181+ * Test that a template replacement cannot template structure HTML.
1182+ *
1183+ * @ticket 60229
1184+ *
1185+ * @covers ::render
1186+ */
1187+ public function test_replacements_cannot_modify_template_structure () {
1188+ $ this ->markTestSkipped ( 'Template HTML structure protection is not implemented. ' );
1189+
1190+ // Three occurrences of "disabled": placeholder + two duplicates.
1191+ $ result = T::render (
1192+ '<a></%link-text></a> ' ,
1193+ array ( 'link-text ' => WP_HTML_Template::template ( '<a>A elements cannot nest in HTML</a> ' ) )
1194+ );
1195+ $ this ->assertFalse ( $ result , 'Should have rejected the template with an invalid replacement. ' );
1196+ }
11791197}
You can’t perform that action at this time.
0 commit comments