@dev-101 opened this Issue on February 1st 2019

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

&<a href='/38'>#38</a>;

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 commented on February 1st 2019 Member

Cheers 👍

@fdellwing commented on February 4th 2019 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 commented on February 4th 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.

Powered by GitHub Issue Mirror