merged branch Ziumin/2.0 (PR #4076)

Commits
-------

2e7d3b1 http_build_query fix
de73de0 http_build_query fix
3b7ee9a http_build_query fix

Discussion
----------

[2.0] http_build_query extra parameters

Bug fix: yes

arg_separator.output is not always "&", so it is better ini_set it or put an extra parameters to http_build_query

---------------------------------------------------------------------------

by fabpot at 2012-04-23T10:20:05Z

Can you squash your commits? It will be much easier to get back to this change later on. Thanks.

---------------------------------------------------------------------------

by Ziumin at 2012-04-23T10:46:35Z

I have no idea how to do it using web interface. I'm not familiar with git (prefer hg). Sorry.
This commit is contained in:
Fabien Potencier 2012-04-23 12:56:33 +02:00
commit c9424c61de
3 changed files with 5 additions and 5 deletions

View File

@ -190,14 +190,14 @@ class HttpKernel extends BaseHttpKernel
return $controller;
}
$path = http_build_query($attributes);
$path = http_build_query($attributes, '', '&');
$uri = $this->container->get('router')->generate('_internal', array(
'controller' => $controller,
'path' => $path ?: 'none',
'_format' => $this->container->get('request')->getRequestFormat(),
));
if ($queryString = http_build_query($query)) {
if ($queryString = http_build_query($query, '', '&')) {
$uri .= '?'.$queryString;
}

View File

@ -141,7 +141,7 @@ class Form extends Link implements \ArrayAccess
*/
public function getPhpValues()
{
$qs = http_build_query($this->getValues());
$qs = http_build_query($this->getValues(), '', '&');
parse_str($qs, $values);
return $values;
@ -159,7 +159,7 @@ class Form extends Link implements \ArrayAccess
*/
public function getPhpFiles()
{
$qs = http_build_query($this->getFiles());
$qs = http_build_query($this->getFiles(), '', '&');
parse_str($qs, $values);
return $values;

View File

@ -146,7 +146,7 @@ class UrlGenerator implements UrlGeneratorInterface
// add a query string if needed
$extra = array_diff_key($originParameters, $variables, $defaults);
if ($extra && $query = http_build_query($extra)) {
if ($extra && $query = http_build_query($extra, '', '&')) {
$url .= '?'.$query;
}