Skip to content

Embedded % symbol crashes  #92

@axtens

Description

@axtens

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions