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

JS: Uncaught URIError: URI malformed with Chrome/IE11 and ISO 8859-1 Encoding #8413

Closed
stastka opened this issue Jul 23, 2015 · 6 comments
Closed
Assignees
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Milestone

Comments

@stastka
Copy link

stastka commented Jul 23, 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

/Hasenb%F6hler-Franz
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
Copy link
Member

mattab commented Jul 28, 2015

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

@mattab mattab added this to the 2.15.0 milestone Jul 28, 2015
@stastka
Copy link
Author

stastka commented Jul 28, 2015

Hi @mattab

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

http://stastka.ch/piwiktest/

@meyway
Copy link

meyway commented Jul 30, 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
Copy link
Author

stastka commented Aug 3, 2015

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

@tsteur tsteur self-assigned this Aug 7, 2015
@tsteur tsteur added the Bug For errors / faults / flaws / inconsistencies etc. label Aug 7, 2015
@stastka
Copy link
Author

stastka commented Aug 17, 2015

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

@tsteur
Copy link
Member

tsteur commented Aug 17, 2015

Thx for the feedback!

@mattab mattab changed the title Piwik, 2.14.x: Javascript Error: Uncaught URIError: URI malformed with Chrome/IE11 and ISO 8859-1 Encoding JS: Uncaught URIError: URI malformed with Chrome/IE11 and ISO 8859-1 Encoding Oct 13, 2015
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

No branches or pull requests

4 participants