Skip to content

URL Path is Decoded Twice, leading to errors or worse if the escape character % is present in the decoded string #278

@dbkang

Description

@dbkang

$location.path() in AngularJS already returns a decoded string (see how $$path is set), but UrlMatcher.prototype.exec, which takes path from $location.path() calls decodeURIComponent again on decoded string, which results in an error or possibly an incorrect string if the decoded string itself contains the escape character.

Also, I don't know if this is compensating for the other bug, but in UrlMatcher.prototype.format, encodeURIComponent is missing for the path part of the URL - should be result += encodeURIComponent(value).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions