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

Some HTML entities are incorrectly transformed to UTF8 symbols (e.g. in URLs) #169

Open
samupl opened this issue Dec 29, 2023 · 2 comments

Comments

@samupl
Copy link

samupl commented Dec 29, 2023

When working on something I noticed (in a django app) that some URLs were rendered incorrectly.

The url in question had a query param called copy_origin. When the query param was not first (e.g. rendered as &copy_origin=something then it got transformed to the © symbol. This doesn't happen if the param is just called copy, the following underscore seems to make minify-html think it's a valid entity.

I found a few more examples.

This issue is happening at least since 0.11 up until the latest version 0.15:

echo '<a href="/example?attribute=something&copy_something=1&reg_something=1&euro_something=1&yen_something=1">test</a>' | ./minhtml-0.15.0-x86_64-unknown-linux-gnu
<a href=/example?attribute=something©_something=1®_something=1&euro_something=1¥_something=1>test</a>%       
@samupl
Copy link
Author

samupl commented Feb 1, 2024

@wilsonzlin Could you verify if this is a bug, or perhaps if it's not just me making incorrect assumptions about the minification?

@milen-denev
Copy link

milen-denev commented Feb 20, 2024

Hello there, I am leaving this link here: https://denevcloud.azureedge.net/gumeristore/assets/js/minipopup-open.js to try out, this is not correctly minified and the return vector cannot be decoded. container UTF8 chars. Try it yourself guys.

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

2 participants