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:
Mole
2022-01-31 15:02:25 +01:00
committed by GitHub
parent c0dfb33916
commit 3af6645ad8
2 changed files with 12 additions and 5 deletions

View File

@@ -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));
}
}
}