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