Lost case of text when using Core.EscapeInvalidTags
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 3.4k
- Forks
- 361
- Avg merge
- 3d 41m
- Merged PRs (30d)
- 2
Description
Hello!
Let's check following code:
$allowedTagsList = [
'a',
'p',
'div',
];
$config = HTMLPurifier_Config::createDefault();
$config->set('Core.EscapeInvalidTags', true);
$config->set('HTML.AllowedElements', $allowedTagsList);
$purifier = new HTMLPurifier($config);
$htmlBody = $purifier->purify($htmlBody);
$htmlBody before purifying
<p>Hello! I want attach following xml:</p><p><someGreatTag>someGreatValue</someGreatTag></p>
Expected after purifying
<p>Hello! I want attach following xml:</p><p><someGreatTag>someGreatValue</someGreatTag></p>
But in reality
<p>Hello! I want attach following xml:</p><p><somegreattag>someGreatValue</somegreattag></p>
So, any denied tag lose capitalization (someGreatTag -> somegreattag)
php 7.4.27
htmlpurifier 4.14.0
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the behavior with the provided PHP snippet using Core.EscapeInvalidTags and HTML.AllowedElements, then trace how the denied tag is handled during purify(). Done means escaped denied tags retain the original capitalization, such as someGreatTag, while the surrounding allowed HTML remains unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- security
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100