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

Skip to content

[HttpFoundation] Request path can be wrong #6634

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

Closed
Tobion opened this issue Jan 9, 2013 · 2 comments
Closed

[HttpFoundation] Request path can be wrong #6634

Tobion opened this issue Jan 9, 2013 · 2 comments

Comments

@Tobion
Copy link
Contributor

Tobion commented Jan 9, 2013

There is a problem with the path info in the Request class.

Given a request to http://localhost/symfony-standard/app_dev.php, the info in the Request are as follows:
Request::getBaseUrl() returns /symfony-standard/app_dev.php (correct)
Request::getPathInfo() returns / which is wrong because it must be empty ``.

The reason is that Request::getBaseUrl() . Request::getPathInfo() must represent the real request path. Since it is lying about the real path, #3958 generates the incorrect relative path based on the wrong info.

So there is a problem when the path info should be empty but never is (it defaults to /).
I think it's this commit that should be reverted: 62d09b8

ping @fabpot

@cmfcmf
Copy link
Contributor

cmfcmf commented Jun 26, 2014

Could this be assigned to a milestone? I think an error in the Request class is quite important.

@Tobion
Copy link
Contributor Author

Tobion commented Oct 8, 2014

@fabpot would you accept a PR that changes this back? Users of the Request class have to be aware that the pathinfo can be empty ('') when using a script in the path. The only other solution I see is to introduce a new method in the Request class with the corrected behavior and leave the current method as-is. Then we can dump the requirement in the Routing component for instance and use the new method. This would avoid a BC break but make the request class even more uglier than it already is.

@Tobion Tobion closed this as completed Oct 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants