-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
The "," character should not be escaped in query strings using the URL generator #27266
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
Comments
@egonolieux I'm not agree. The ',' seems to be a reserved character read more here |
A common approach is to use |
It might be a reseverd character indeed, but that does not mean it cannot be used in a certain context.
and
|
#12223 is a precedent things like this are allowed to be done in symfony In any case, this is not a bug |
@ostrolucky I wouldn't suggest hardcoding things like comma's though. The issue you referred to regarding Because there are many more characters than The main issue is that if an URL with such characters in the query string is entered, the next page (using pagination for example), encodes these characters by default causing the URL to change. |
Is there something to do here ? |
I'm fine with adding the |
I opened a PR for this. |
…obion) This PR was merged into the 4.3-dev branch. Discussion ---------- [Routing] do not encode comma in query and fragment | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | #27266 | License | MIT | Doc PR | Commits ------- 76f6c97 [Routing] allow comma and other reserved chars without special meaing to not be encoded in the query and fragment
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:
produces https://www.example.com/path?category=1%2C2 instead of https://example.com/path?category=1,2.
The text was updated successfully, but these errors were encountered: