minor #26233 Clean calls to http_build_query() (nicolas-grekas)

This PR was merged into the 2.7 branch.

Discussion
----------

Clean calls to http_build_query()

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

Commits
-------

4055224 Clean calls to http_build_query()
This commit is contained in:
Nicolas Grekas 2018-02-19 17:21:10 +01:00
commit 862e347623
5 changed files with 5 additions and 5 deletions

View File

@ -209,7 +209,7 @@ class Form extends Link implements \ArrayAccess
parse_str($query, $currentParameters);
}
$queryString = http_build_query(array_merge($currentParameters, $this->getValues()), null, '&');
$queryString = http_build_query(array_merge($currentParameters, $this->getValues()), '', '&');
$pos = strpos($uri, '?');
$base = false === $pos ? $uri : substr($uri, 0, $pos);

View File

@ -522,7 +522,7 @@ class Request
*/
public function overrideGlobals()
{
$this->server->set('QUERY_STRING', static::normalizeQueryString(http_build_query($this->query->all(), null, '&')));
$this->server->set('QUERY_STRING', static::normalizeQueryString(http_build_query($this->query->all(), '', '&')));
$_GET = $this->query->all();
$_POST = $this->request->all();

View File

@ -2065,7 +2065,7 @@ class RequestContentProxy extends Request
{
public function getContent($asResource = false)
{
return http_build_query(array('_method' => 'PUT', 'content' => 'mycontent'));
return http_build_query(array('_method' => 'PUT', 'content' => 'mycontent'), '', '&');
}
}

View File

@ -89,7 +89,7 @@ class SwitchUserListener implements ListenerInterface
}
$request->query->remove($this->usernameParameter);
$request->server->set('QUERY_STRING', http_build_query($request->query->all()));
$request->server->set('QUERY_STRING', http_build_query($request->query->all(), '', '&'));
$response = new RedirectResponse($request->getUri(), 302);

View File

@ -128,7 +128,7 @@ class LogoutUrlGenerator
$url = UrlGeneratorInterface::ABSOLUTE_URL === $referenceType ? $request->getUriForPath($logoutPath) : $request->getBaseUrl().$logoutPath;
if (!empty($parameters)) {
$url .= '?'.http_build_query($parameters);
$url .= '?'.http_build_query($parameters, '', '&');
}
} else {
if (!$this->router) {