From 3adf386aa309cdce1652ed46e9e3b1224fce15be Mon Sep 17 00:00:00 2001 From: Rick Falkvinge Date: Tue, 17 Oct 2017 10:56:13 +0200 Subject: [PATCH] Fourth proper fix for security exception --- Site/Pages/v5/Public/Signup.aspx | 6 +++++- Site/Pages/v5/Public/Signup.aspx.cs | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Site/Pages/v5/Public/Signup.aspx b/Site/Pages/v5/Public/Signup.aspx index 6c658d8a..dea2dfbd 100644 --- a/Site/Pages/v5/Public/Signup.aspx +++ b/Site/Pages/v5/Public/Signup.aspx @@ -553,7 +553,11 @@ function setLanguage(cultureCode) { - document.location = document.location + "?Culture=" + cultureCode; + if (document.location.indexOf("?OrganizationId") > 0) { + document.location = document.location + "&Culture=" + cultureCode; + } else { + document.location = document.location + "?Culture=" + cultureCode; + } } var suppressChecks = false; diff --git a/Site/Pages/v5/Public/Signup.aspx.cs b/Site/Pages/v5/Public/Signup.aspx.cs index 259f3571..251676ce 100644 --- a/Site/Pages/v5/Public/Signup.aspx.cs +++ b/Site/Pages/v5/Public/Signup.aspx.cs @@ -42,7 +42,7 @@ namespace Swarmops.Frontend.Pages.Public if (Request["Culture"] != null) { Response.SetCookie(new HttpCookie("PreferredCulture", Request["Culture"])); - Response.Redirect(Request.RawUrl.Substring (0, Request.RawUrl.IndexOf ("?Culture=")), true); + Response.Redirect(Request.RawUrl.Substring (0, Request.RawUrl.IndexOf ("Culture=")-1), true); // "-1" removes the preceding & or ? } // Find what organization we're supposed to sign up to