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

Embedded % symbol crashes #92

Closed
axtens opened this issue May 27, 2013 · 1 comment
Closed

Embedded % symbol crashes #92

axtens opened this issue May 27, 2013 · 1 comment
Labels

Comments

@axtens
Copy link

axtens commented May 27, 2013

Context: Microsoft JScript on Windows Server 2008 R2 64bit

var url = "http://www.google.com/url?sa=t&rct=j&q=% FREE Call Forwarding&source=web&cd=27&cad=rja&ved=0CG8QFjAGOBQ";
var x = new URI(url);
var rMap = x.search(true);

When the .search is executed I get

Microsoft JScript runtime error: The URI to be decoded is not a valid encoding

The break occurs here

d.decodeQuery = function (a) {
    return d.decode((a + "").replace(/+/g, "%20"))
};

It's probably complaining about the "q=% FREE Call Forwarding". The percent symbol in this case is not introducing an encoded value. In my own code I'll check for a % after unescaping and change it to something (not sure what yet). However, what can be done for URI.js?

@rodneyrehm
Copy link
Member

I've fixed this in master - it will be included in the next release. thank you for your help!

QueryString data that cannot be decoded will now simply be returned undecoded - that way any decodable data can still be of use.

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

No branches or pull requests

2 participants