diff --git a/app/helpers/profile.php b/app/helpers/profile.php index cc1e780..d90256b 100644 --- a/app/helpers/profile.php +++ b/app/helpers/profile.php @@ -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; } ?>