8000 [Routing] fix trailing slash matching with empty-matching trailing vars by nicolas-grekas · Pull Request #31182 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Routing] fix trailing slash matching with empty-matching trailing vars #31182

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
Apr 19, 2019

Conversation

nicolas-grekas
Copy link
Member
@nicolas-grekas nicolas-grekas commented Apr 19, 2019
Q A
Branch? 4.2
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets -
License MIT
Doc PR -

Reported by @bmack in #31107 (comment)

This highlights a small inconsistency that exists for a long time (checked on 2.7 at least):
new Route('/en-en/{b}', ['b' => 'bbb'], ['b' => '.*']) matches /en-en/
new Route('/en-en/{b}', ['b' => 'bbb'], ['b' => '.+']) doesn't match it
(while both match /en-en and /en-en/foo)

This PR ensures the former behavior is preserved, while #31167 redirects the later to /en-en.

@nicolas-grekas nicolas-grekas added this to the 4.2 milestone Apr 19, 2019
@nicolas-grekas nicolas-grekas merged commit d6da21a into symfony:4.2 Apr 19, 2019
nicolas-grekas added a commit that referenced this pull request Apr 19, 2019
…trailing vars (nicolas-grekas)

This PR was merged into the 4.2 branch.

Discussion
----------

[Routing] fix trailing slash matching with empty-matching trailing vars

| Q             | A
| ------------- | ---
| Branch?       | 4.2
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Reported by @bmack in #31107 (comment)

This highlights a small inconsistency that exists for a long time (checked on 2.7 at least):
`new Route('/en-en/{b}', ['b' => 'bbb'], ['b' => '.*'])` matches `/en-en/`
`new Route('/en-en/{b}', ['b' => 'bbb'], ['b' => '.+'])` doesn't match it
(while both match `/en-en` and `/en-en/foo`)

This PR ensures the former behavior is preserved, while #31167 redirects the later to `/en-en`.

Commits
-------

d6da21a [Routing] fix trailing slash matching with empty-matching trailing vars
@nicolas-grekas nicolas-grekas deleted the route-fix branch April 19, 2019 14:35
@bmack
Copy link
bmack commented Apr 24, 2019

Thanks for the fix @nicolas-grekas - works fine for TYPO3!

@fabpot fabpot mentioned this pull request May 1, 2019
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.

3 participants
0