@stastka opened this Issue on July 23rd 2015

If Website has ISO 8859-1 encoding, you have Uncaught URIError Javascript error with Chrome (and IE) when URL have some special character

Samples with French character:
URL: /Les-droits-r%E9els
decode: /Les droits réels

or with German Umlaut

decode: Hasenböhler-Franz

Detailed Error:
Uncaught URIError: URI malformedD @ piwik.js:30(anonymous function) @ piwik.js:51(anonymous function) @ piwik.js:52

I used latest Piwik, 2.14.x

@mattab commented on July 28th 2015 Member

Hi @stastka
Thanks for the report.

Let's try to reproduce and then:

  • add a test showing the bug in tests/javascript/
  • fix the issue
@stastka commented on July 28th 2015

Hi @mattab

I create a small testpage to reproduce. The site contains links with french and german characters with ISO 8859-1 encoding. :


@meyway commented on July 30th 2015

Line 2140 of the current piwik.js:
locationHrefAlias = decodeWrapper(locationArray[1])

"decodeWrapper" is "window.decodeURIComponent" and "decodeURIComponent" expects UTF-8.

Since "locationArray[1]" holds "window.location.href" and since that contains the ISO-8859-... - characters, current piwik (IMHO) is not fully compatible with websites that encode Links in ISO-8859-...

Is the use of "unescape" instead of / before using "decodeURIComponent" a solution to the problem?

@stastka commented on August 3rd 2015

Seems to resolve the issue possible.
I would test a patch on my system

@stastka commented on August 17th 2015

@tsteur @mattab
I testet the patch e8bde681ec380b53ed15fa14a994176dffa5d58f and i have no error. The visitor log on Piwik show the visiting Test-Page. The Patch resolve the issue.

@tsteur commented on August 17th 2015 Member

Thx for the feedback!

This Issue was closed on August 17th 2015
Powered by GitHub Issue Mirror