Fixed tryParse
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using System.Globalization;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Umbraco.Cms.Core.Configuration.Models;
|
||||
@@ -60,7 +61,7 @@ namespace Umbraco.Cms.Core.Routing
|
||||
{
|
||||
var noSlashPath = path.Substring(1);
|
||||
|
||||
if (int.TryParse(noSlashPath, out nodeId) == false)
|
||||
if (int.TryParse(noSlashPath, NumberStyles.Integer, CultureInfo.InvariantCulture, out nodeId) == false)
|
||||
{
|
||||
nodeId = -1;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using System.Globalization;
|
||||
using Umbraco.Cms.Core.Models.PublishedContent;
|
||||
using Umbraco.Cms.Core.Web;
|
||||
using Umbraco.Extensions;
|
||||
@@ -32,7 +33,7 @@ namespace Umbraco.Cms.Core.Routing
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (int.TryParse(_requestAccessor.GetRequestValue("umbPageID"), out int pageId))
|
||||
if (int.TryParse(_requestAccessor.GetRequestValue("umbPageID"), NumberStyles.Integer, CultureInfo.InvariantCulture, out int pageId))
|
||||
{
|
||||
IPublishedContent doc = umbracoContext.Content.GetById(pageId);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user