From e5d13241268f012f92921eafbcb9a406df520056 Mon Sep 17 00:00:00 2001 From: Yasen Pramatarov Date: Wed, 25 Sep 2024 09:51:26 +0300 Subject: [PATCH] Fixes platform switcher --- app/helpers/profile.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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; } ?>