suncat2000 / MobileDetectBundle

Symfony 2/3/4 bundle for detect mobile devices, manage mobile view and redirect to the mobile and tablet version.
398 stars 154 forks source link

Doubled up query string after redirect #63

Closed nicgordon closed 9 years ago

nicgordon commented 9 years ago

Line 279 of EventListener/RequestListener.php reads

return $this->redirectConf[$platform]['host'] . $this->container->get('request')->getRequestUri() . '?' . Request::normalizeQueryString(http_build_query($queryParams));

The problem is that the returned value from $this->container->get('request')->getRequestUri() includes the query string from the original request.

So a url like http://example.com/?foo=bar gets redirected to http://m.example.com/?foo=bar?device_view=mobile&foo=bar

netmikey commented 9 years ago

Thanks for the report! This should be fixed in v0.10.1.

nicgordon commented 9 years ago

Thanks!