Skip to content

Commit

Permalink
Add a test case to confirm that a deprecated error is not shown when …
Browse files Browse the repository at this point in the history
…the attribute name is numeric and DirectLex is used
  • Loading branch information
matsuo committed Jul 29, 2024
1 parent 70754a2 commit c2aadb6
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/HTMLPurifier/HTMLDefinitionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,17 @@ public function test_AllowedAttributes_multipleErrors()
$this->assertPurification_AllowedAttributes_local_p_style();
}

public function test_AllowedAttributes_invalidAttributeDueToConsistingOfNumbers_UsingDirectLex()
{
$this->config->set('HTML.AllowedElements', array('a'));
$this->config->set('HTML.AllowedAttributes', 'href');
$this->config->set('Core.LexerImpl', 'DirectLex');
$this->assertPurification(
'<a href="https://example.com/" 10="hoge">Test</a>',
'<a href="https://example.com/">Test</a>'
);
}

public function test_ForbiddenElements()
{
$this->config->set('HTML.ForbiddenElements', 'b');
Expand Down

0 comments on commit c2aadb6

Please sign in to comment.