Fixes platform switcher
parent
6cc1efff15
commit
e5d1324126
|
@ -31,18 +31,18 @@ function switchPlatform($platform_id) {
|
||||||
if (isset($query_params['platform'])) {
|
if (isset($query_params['platform'])) {
|
||||||
// change the platform to the new platform_id
|
// change the platform to the new platform_id
|
||||||
$query_params['platform'] = $platform_id;
|
$query_params['platform'] = $platform_id;
|
||||||
|
$new_query_string = http_build_query($query_params);
|
||||||
|
|
||||||
|
// there is no 'platform', we redirect to front page of the new platform_id
|
||||||
|
} else {
|
||||||
|
$new_query_string = 'platform=' . $platform_id;
|
||||||
|
}
|
||||||
|
|
||||||
// rebuild the query and the URL
|
// rebuild the query and the URL
|
||||||
$new_query_string = http_build_query($query_params);
|
|
||||||
$new_url = $scheme . '://' . $url_components['host'] . $url_components['path'] . '?' . $new_query_string;
|
$new_url = $scheme . '://' . $url_components['host'] . $url_components['path'] . '?' . $new_query_string;
|
||||||
|
|
||||||
// return the new URL with the new platform_id
|
// return the new URL with the new platform_id
|
||||||
return $new_url;
|
return $new_url;
|
||||||
|
|
||||||
// there is no 'platform', we redirect to front page of the new platform_id
|
|
||||||
} else {
|
|
||||||
return $current_url;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
Loading…
Reference in New Issue