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

Avoid double HTML entities / special characters encoding #14065

Closed
dev-101 opened this issue Feb 1, 2019 · 4 comments · Fixed by #17470
Closed

Avoid double HTML entities / special characters encoding #14065

dev-101 opened this issue Feb 1, 2019 · 4 comments · Fixed by #17470
Assignees
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Milestone

Comments

@dev-101
Copy link

dev-101 commented Feb 1, 2019

Hi, if the page's <title> (in <head> section) contains for e.g. already encoded & character:

&#38;

or:

&amp;


M will encode it again, resulting in:

&amp;amp;

being displayed in the tooltip (but tooltip just copies values from <img> element)


which, again, will look like this in HTML:

&amp;

which is wrong.


It should simply be/look like this:

&

because it is already encoded HTML entity.

See screenshots for illustration.

matomo-html-char-encoding-bug-1
matomo-html-char-encoding-bug-2

@tsteur tsteur added Bug For errors / faults / flaws / inconsistencies etc. Help wanted Beginner friendly issues or issues where we'd highly appreciate community's help and involvement. labels Feb 1, 2019
@tsteur tsteur added this to the 3.10.0 milestone Feb 1, 2019
@tsteur
Copy link
Member

tsteur commented Feb 1, 2019

Cheers 👍

@fdellwing
Copy link
Contributor

I guess the "fix" here would be to first decode it and then encode it again to make sure everything is fine?

@dev-101
Copy link
Author

dev-101 commented Feb 4, 2019

If I understand you correctly, just leave things stored in database as they are, and simply use htmlspecialchars_decode($title) for display purposes.

edit: I forgot that it does 2 times encoding, when it should use decoding.

@tsteur tsteur modified the milestones: 3.10.0, 3.9.0 Feb 4, 2019
@tsteur tsteur removed the Help wanted Beginner friendly issues or issues where we'd highly appreciate community's help and involvement. label Feb 7, 2019
@mattab mattab modified the milestones: 3.9.0, 3.10.0 Mar 18, 2019
@mattab mattab modified the milestones: 3.10.0, 3.12.0 Jun 11, 2019
@tsteur tsteur modified the milestones: 3.13.0, 4.1.0 Jul 31, 2019
@johsin18
Copy link
Contributor

johsin18 commented Apr 1, 2020

I also experience this bug, and would like to have it fixed.

@mattab mattab modified the milestones: 4.1.0, 4.2.0 Dec 21, 2020
@mattab mattab modified the milestones: 4.2.0, 4.3.0 Feb 22, 2021
@flamisz flamisz self-assigned this Apr 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants