MobileDetectBundle
MobileDetectBundle copied to clipboard
Fix : Redirect to request Uri instead of pathInfo
Hello,
Asking for http://hostname.dev/app_dev.php/path
redirects to http://m.hostname.dev/path
and does not preserve app_dev.php
.
Is there any reason for using pathInfo instead of request URI ?
If not, here's the change you could merge.
Thanks in advance for your time and answer.
@vrcAlbert : The issue however is that the Request::getRequestUri()
method also returns the query string.
You may want to remove this line:
- Request::normalizeQueryString(http_build_query($queryParams, null, '&'))
But still, l.287 is added the switch param, which is not part of the current request.
So, I'd suggest to simply concatenate the result of the Request::getBaseUrl()
method instead.
This fix should also be applied to the RequestResponseListener::REDIRECT_WITHOUT_PATH
case.
Thanks @ogizanagi for pointing that out !
Concerning REDIRECT_WITHOUT_PATH
, there could be a case in which we would use that option to explicitely remove the base script. I'll let @suncat2000 giving his final word about it :)
Thanks again for the review.