Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[HttpKernel] trim the leading backslash in the controller init#32541
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
[HttpKernel] trim the leading backslash in the controller init#32541
Uh oh!
There was an error while loading.Please reload this page.
Conversation
src/Symfony/Component/HttpKernel/Controller/ControllerResolver.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/HttpKernel/Controller/ControllerResolver.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/HttpKernel/Controller/ControllerResolver.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
dce0fc6 toa8ec428CompareSimperfit commentedJul 15, 2019
updated Status: Needs Review |
fabpot commentedJul 15, 2019
I would trim only when really needed. What makes trimming neeeded in the first place? |
Simperfit commentedJul 15, 2019
fabpot commentedJul 15, 2019
You've changed a method that deals with errors, so this looks suspicious to me. |
a8ec428 to029f653CompareSimperfit commentedJul 15, 2019
Okay I've misread the whole think, was only thinking about the comment, but hey, this is the right fix and I understand why is was deprecated. So maybe the even better fix is to deprecate using backslash like in the first PR that has been closed ;). WDYT@fabpot ? |
fabpot commentedAug 9, 2019
I think I still don't get the problem. Can you explain it to me again? Perhaps with an example? |
Pierstoval commentedAug 9, 2019
IIUC, this PR fixes issues when defining routes like this: my_route:path:/whatevercontroller:\App\Controller\DefaultController Not sure it's really common, but IMO this should be supported anyway |
029f653 to8be6297Compare8be6297 to3c8d395Comparefabpot commentedAug 9, 2019
Thank you@Simperfit. |
…init (Simperfit, fabpot)This PR was submitted for the 4.4 branch but it was merged into the 4.3 branch instead (closes#32541).Discussion----------[HttpKernel] trim the leading backslash in the controller init| Q | A| ------------- | ---| Branch? | 4.4| Bug fix? | no| New feature? | no <!-- please update src/**/CHANGELOG.md files -->| BC breaks? | no <!-- seehttps://symfony.com/bc -->| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->| Tests pass? | yes <!-- please add some, will be required by reviewers -->| Fixed tickets |#29945| License | MIT| Doc PR | none <!-- required for new features --><!--Replace this notice by a short README for your feature/bugfix. This will help peopleunderstand your PR and can be used as a start for the documentation.Additionally (seehttps://symfony.com/roadmap): - Bug fixes must be submitted against the lowest maintained branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against branch 4.4. - Legacy code removals go to the master branch.-->This fixes an error where the classes exists when using a leading backslash in the controller, it's not invalid to do so.see#30045 (comment)Commits-------3c8d395 [HttpKernel] fixed class having a leading \ in a route controller6fdf252 [HttpKernel] trim the leading backslash in the controller init
This fixes an error where the classes exists when using a leading backslash in the controller, it's not invalid to do so.
see#30045 (comment)