SEBWIN-414: Ensured query string parameter is correctly appended to start URL.

This commit is contained in:
Damian Büchel 2020-09-24 17:01:23 +02:00
parent 50e943e8a8
commit 3a23cec2c2

View file

@ -207,7 +207,14 @@ namespace SafeExamBrowser.Browser
if (settings.UseQueryParameter)
{
url = $"{url}{settings.StartUrlQuery}";
if (url.Contains("?") && settings.StartUrlQuery?.Length > 1 && Uri.TryCreate(url, UriKind.Absolute, out var uri))
{
url = url.Replace(uri.Query, $"{uri.Query}&{settings.StartUrlQuery.Substring(1)}");
}
else
{
url = $"{url}{settings.StartUrlQuery}";
}
}
return url;