Skip to content

urlEncode should use url.PathEscape not url.QueryEscape #286

@idc77

Description

@idc77

the urlescape filter is using url.QueryEscape and not url.PathEscape.
You might have PHP roots where urlencode is used, but url.QueryEscape is not the proper replacement as is encodes QUERIES not PATHS.
An URL has paths and queries.

There should be pathEscape and queryEscape and for compatibility reasons urlescape should be using url.PathEscape, in the long run urlescape should be deprecated.

Why? Because if you use QueryEscape to encode a PATH you will receive wrong results

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions