Skip to content

Commit f2fa469

Browse files
committed
Add test with null bytes in class attribute
1 parent ed8f34f commit f2fa469

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -658,4 +658,17 @@ public function test_class_list_quirks_mode() {
658658
$class_list
659659
);
660660
}
661+
662+
/**
663+
* Ensures that the tag processor matches class names with null bytes correctly.
664+
*
665+
* @ticket 61531
666+
*
667+
* @covers ::has_class
668+
*/
669+
public function test_has_class_null_byte_class_name() {
670+
$processor = WP_HTML_Processor::create_fragment( "<span class='null-byte-\0-there'></span>" );
671+
$processor->next_tag();
672+
$this->assertTrue( $processor->has_class( 'null-byte-�-there' ) );
673+
}
661674
}

0 commit comments

Comments
 (0)