Fix URL with culture (#11886)
* Ignore casing when comparing default culture * Ignore casing in GetAssignedWithCulture Co-authored-by: Bjarke Berg <mail@bergmania.dk>
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Umbraco.Cms.Core.PublishedCache;
|
||||
|
||||
@@ -9,7 +10,8 @@ namespace Umbraco.Cms.Infrastructure.PublishedCache
|
||||
{
|
||||
var assigned = domainCache.GetAssigned(documentId, includeWildcards);
|
||||
|
||||
return culture is null ? assigned.Any() : assigned.Any(x => x.Culture == culture);
|
||||
// It's super important that we always compare cultures with ignore case, since we can't be sure of the casing!
|
||||
return culture is null ? assigned.Any() : assigned.Any(x => x.Culture.Equals(culture, StringComparison.InvariantCultureIgnoreCase));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user