Thanks to visit codestin.com
Credit goes to github.com

Skip to content

The "," character should not be escaped in query strings using the URL generator #27266

Closed
@egonolieux

Description

@egonolieux

Symfony version(s) affected: 3.4.8

Description

I have a query string in which multiple values for a single parameter are delimited by a comma ",". According to RFC 3986 this comma does not need to be escaped in the query string. However, when I try to generate routes using the URL generator, the comma seems to get encoded. Is this by design or is this an oversight?

For example, the following code:

$url = $urlGenerator->generate('routeName', array(
    'category' => '1,2'
));

produces https://www.example.com/path?category=1%2C2 instead of https://example.com/path?category=1,2.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions