Skip to content

Commit

Permalink
Only parse query string if not empty (#205)
Browse files Browse the repository at this point in the history
  • Loading branch information
aschempp committed Oct 12, 2021
1 parent 0b4cef8 commit 6bba99a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/FrontendModule/ChangeLanguageModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,10 @@ protected function createUrlParameterBag(array $queryParameters = [])
// the current page language is set in $_GET
unset($input['language'], $input['auto_item']);

parse_str($_SERVER['QUERY_STRING'], $currentQuery);
$currentQuery = [];
if (!empty($_SERVER['QUERY_STRING'])) {
parse_str($_SERVER['QUERY_STRING'], $currentQuery);
}

foreach ($input as $k => $value) {
// GET parameters can be an array
Expand Down

0 comments on commit 6bba99a

Please sign in to comment.