8000 [FrameworkBundle] forward the query params when redirecting · symfony/symfony@c8c18f2 · GitHub
[go: up one dir, main page]

Skip to content

Commit c8c18f2

Browse files
author
Amrouche Hamza
committed
[FrameworkBundle] forward the query params when redirecting
1 parent 63736e7 commit c8c18f2

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/Symfony/Bundle/FrameworkBundle/Controller/RedirectController.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,7 @@ public function __construct(UrlGeneratorInterface $router = null, int $httpPort
4646
* In case the route name is empty, the status code will be 404 when permanent is false
4747
* and 410 otherwise.
4848
*
49-
* @param Request $request The request instance
50-
* @param string $route The route name to redirect to
51-
* @param bool $permanent Whether the redirection is permanent
5249
* @param bool|array $ignoreAttributes Whether to ignore attributes or an array of attributes to ignore
53-
* @param bool $keepRequestMethod Wheter redirect action should keep HTTP request method
5450
*
5551
* @throws HttpException In case the route name is empty
5652
*/
@@ -61,11 +57,11 @@ public function redirectAction(Request $request, string $route, bool $permanent
6157
}
6258

6359
$attributes = array();
64-
if (false === $ignoreAttributes || is_array($ignoreAttributes)) {
60+
if (false === $ignoreAttributes || \is_array($ignoreAttributes)) {
6561
$attributes = \array_merge($request->query->all(), $request->attributes->get('_route_params'));
6662
unset($attributes['route'], $attributes['permanent'], $attributes['ignoreAttributes'], $attributes['keepRequestMethod']);
6763
if ($ignoreAttributes) {
68-
$attributes = array_diff_key($attributes, array_flip($ignoreAttributes));
64+
$attributes = \array_diff_key($attributes, \array_flip($ignoreAttributes));
6965
}
7066
}
7167

0 commit comments

Comments
 (0)
0