Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

IE11 Error: Invalid argument when parsing a link href containing a percent sign #13388

Open
pneyer opened this issue Nov 26, 2015 · 7 comments
Open

Comments

@pneyer
Copy link

pneyer commented Nov 26, 2015

Hi

Angular cannot render links with percent signs in it when using IE11 as a browser.
A valid email address like test%me@github.com inside an <a ng-href="..."> logs an error to IE11 console "Error: Invalid argument" and the link is not rendered.
Example: <a ng-href="mailto:{{'test%me@github.com'}}">a link</a>

Verified in IE11 version: 11.0.9600.18098 using angular 1.4.8

Reproducible here: http://plnkr.co/edit/9ksVLjk6tFpgRPvZAXVq

Other browsers are not affected, i.e. Chrome
screen shot 2015-11-26 at 16 13 47

@Narretz
Copy link
Contributor

Narretz commented Nov 26, 2015

Stupid IE! Do you know if this happens in IE lower than 11?

@gkalpak
Copy link
Member

gkalpak commented Nov 26, 2015

FYI, it doesn't work on Edge either (but it doesn't throw the error). It just won't set the anchor's href attribute.

@gutierri
Copy link

@Narretz Stupid IE!² This happens in IE 10
angular_bug

andypatterson pushed a commit to andypatterson/angular.js that referenced this issue Dec 7, 2015
IE11/10/Edge fail when setting a href to a URL containing a % that isn't a valid escape sequence
Reference: angular#13388
@andypatterson
Copy link
Contributor

I did some digging, and this turns out to be annoyingly complex. IE doesn't follow the URL spec for percent-encoded bytes: it follows RFC3986 instead (which states that non-escape %s should be escaped to %25).

I've added a unit test in case this changes in future - to prevent this is IE would be a big-ish rewrite of urlUtils.urlResolve

andypatterson pushed a commit to andypatterson/angular.js that referenced this issue Dec 7, 2015
IE11/10/Edge fail when setting a href to a URL containing a % that isn't a valid escape sequence
Reference: angular#13388
andypatterson pushed a commit to andypatterson/angular.js that referenced this issue Dec 7, 2015
IE11/10/Edge fail when setting a href to a URL containing a % that isn't a valid escape sequence
Reference: angular#13388
petebacondarwin pushed a commit that referenced this issue Jan 5, 2016
IE11/10/Edge fail when setting a href to a URL containing a % that isn't a valid escape sequence

See #13388
Closes #13458
petebacondarwin pushed a commit that referenced this issue Jan 5, 2016
IE11/10/Edge fail when setting a href to a URL containing a % that isn't a valid escape sequence

See #13388
Closes #13458
@lsblsb
Copy link

lsblsb commented Feb 28, 2016

Same problem here. I stumbled upon this problem, when accessing obfuscated url encoded email-addresses (mailto link text node contents) with have a lot of % in it. But - it did not break on some same structured strings before. an error was thrown first when I tried to access this string in a loop: "%0E%13%06%02!%19%04%00%5E%04%00%00%03K%08K". Maybe only specific string-sequences including % are affected?...

@Narretz Narretz modified the milestones: 1.4.x, 1.5.x May 27, 2016
@Narretz Narretz modified the milestones: 1.5.x, 1.7.x Apr 12, 2018
@petebacondarwin petebacondarwin modified the milestones: 1.7.x, 1.7.x - won't fix May 16, 2018
@gkalpak
Copy link
Member

gkalpak commented Jan 3, 2019

FWIW, this seems to be fixed on Edge 18.

@mooncser
Copy link

FWIW, this seems to be fixed on Edge 18.

Is this issue solved in IE11?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants