Fixes platform switcher

main
Yasen Pramatarov 2024-09-25 09:51:26 +03:00
parent 6cc1efff15
commit e5d1324126
1 changed files with 7 additions and 7 deletions

View File

@ -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;
}
?>