Skip to content

[Routing] don't decode nor double-encode already encoded slashes when generating URLs #39732

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

Merged
merged 1 commit into from
Feb 5, 2021

Conversation

nicolas-grekas
Copy link
Member

Q A
Branch? 5.x
Bug fix? no
New feature? yes
Deprecations? -
Tickets Fix #13017
License MIT
Doc PR -

Replaces #39339

@nicolas-grekas nicolas-grekas added this to the 5.x milestone Jan 5, 2021
@nicolas-grekas nicolas-grekas force-pushed the router-slash branch 2 times, most recently from 0d1903c to 2c4597e Compare January 6, 2021 08:57
@nicolas-grekas nicolas-grekas changed the title [Routing] don't decode nor double-encode already encoded chars when generating URLs [Routing] don't decode nor double-encode already encoded slashes when generating URLs Jan 6, 2021
@nicolas-grekas
Copy link
Member Author

Now restricted to slashes only.

@fabpot
Copy link
Member

fabpot commented Feb 5, 2021

Thank you @nicolas-grekas.

@Tobion
Copy link
Contributor

Tobion commented Apr 25, 2021

Nice solution. I like it.

nicolas-grekas added a commit that referenced this pull request Mar 8, 2022
…ters (usu)

This PR was merged into the 6.1 branch.

Discussion
----------

[Routing] Avoid double encoded slashes in query parameters

| Q             | A
| ------------- | ---
| Branch?       | 6.1
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | Fix #45114
| License       | MIT
| Doc PR        |

Similar feature as discussed in #13017 and implemented in #39732, however for query parameters and not for path parameters.

This allows to manually encode slashes in query parameters before handing them over to `UrlGenerator` and avoids these slashes to be double encoded. Currently, it's not possible to generate an output with single encoded slashes in query parameters.

See #45114 for further details.

Commits
-------

1421298 [Routing] query parameters: don't decode nor double-encode already encoded slashes when generating URLs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Routing] Url Generator and slashes in url parameters
4 participants