Skip to content

Commit

Permalink
Fixed generating request parameters (#258)
Browse files Browse the repository at this point in the history
  • Loading branch information
aschempp committed Aug 30, 2024
1 parent 155615c commit 6617862
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/FrontendModule/ChangeLanguageModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,12 @@ protected function createUrlParameterBag(array $queryParameters = []): UrlParame
$attributes = [];
$query = [];

if ($request->attributes->has('parameters')) {
$fragments = explode('/', ltrim($request->attributes->get('parameters'), '/'));
if (!empty($parameters = $request->attributes->get('parameters'))) {
$fragments = explode('/', ltrim($parameters, '/'));

// The auto_item parameter must not be retained
if (\count($fragments) % 2 > 0) {
array_unshift($fragments, 'auto_item');
array_shift($fragments);
}

for ($i = 0, $c = \count($fragments); $i < $c; $i += 2) {
Expand Down

0 comments on commit 6617862

Please sign in to comment.