Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lost case of text when using Core.EscapeInvalidTags #314

Open
andreybatalof opened this issue Feb 8, 2022 · 0 comments
Open

Lost case of text when using Core.EscapeInvalidTags #314

andreybatalof opened this issue Feb 8, 2022 · 0 comments

Comments

@andreybatalof
Copy link

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>&lt;someGreatTag&gt;someGreatValue&lt;/someGreatTag&gt;</p>

But in reality
<p>Hello! I want attach following xml:</p><p>&lt;somegreattag&gt;someGreatValue&lt;/somegreattag&gt;</p>

So, any denied tag lose capitalization (someGreatTag -> somegreattag)

php 7.4.27
htmlpurifier 4.14.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant