diff --git a/src/Symfony/Component/Routing/Generator/UrlGenerator.php b/src/Symfony/Component/Routing/Generator/UrlGenerator.php index cdf2b6b4fdd13..2719934c97520 100644 --- a/src/Symfony/Component/Routing/Generator/UrlGenerator.php +++ b/src/Symfony/Component/Routing/Generator/UrlGenerator.php @@ -257,18 +257,15 @@ protected function doGenerate($variables, $defaults, $requirements, $tokens, $pa $url = $schemeAuthority.$this->context->getBaseUrl().$url; } - // extract unused parameters - $extra = array_diff_key($parameters, $variables, $defaults); - - // extract fragment - $fragment = isset($extra['_fragment']) ? $extra['_fragment'] : ''; - unset($extra['_fragment']); - // add a query string if needed $extra = array_udiff_assoc(array_diff_key($parameters, $variables), $defaults, function ($a, $b) { return $a == $b ? 0 : 1; }); + // extract fragment + $fragment = isset($extra['_fragment']) ? $extra['_fragment'] : ''; + unset($extra['_fragment']); + if ($extra && $query = http_build_query($extra, '', '&')) { // "/" and "?" can be left decoded for better user experience, see // http://tools.ietf.org/html/rfc3986#section-3.4 pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy