Format Exception in int.Parse(route.ModuleId)
int.Parse("-1") throws FormatException for cultures other than English (en-US)
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
@using System.Diagnostics.CodeAnalysis
|
||||
@using System.Net
|
||||
@using Microsoft.AspNetCore.Http
|
||||
@using System.Globalization
|
||||
@namespace Oqtane.UI
|
||||
@inject AuthenticationStateProvider AuthenticationStateProvider
|
||||
@inject SiteState SiteState
|
||||
@ -103,7 +104,7 @@
|
||||
_error = "";
|
||||
|
||||
Route route = new Route(_absoluteUri, SiteState.Alias.Path);
|
||||
int moduleid = int.Parse(route.ModuleId);
|
||||
int moduleid = int.Parse(route.ModuleId, CultureInfo.InvariantCulture);
|
||||
var action = route.Action;
|
||||
|
||||
var querystring = Utilities.ParseQueryString(route.Query);
|
||||
@ -263,7 +264,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
editmode = (page.PageId == ((user.Settings.ContainsKey("CP-editmode")) ? int.Parse(user.Settings["CP-editmode"]) : -1));
|
||||
editmode = (page.PageId == ((user.Settings.ContainsKey("CP-editmode")) ? int.Parse(user.Settings["CP-editmode"], CultureInfo.InvariantCulture) : -1));
|
||||
if (!editmode)
|
||||
{
|
||||
var userSettings = new Dictionary<string, string> { { "CP-editmode", "-1" } };
|
||||
|
Reference in New Issue
Block a user