Updated AliasMap

Ordering by key Length rather than key value.
This commit is contained in:
Sipke Schoorstra 2015-09-14 13:21:57 +01:00
parent 8ca6c3367a
commit d0e7c09ba5

View File

@ -172,7 +172,7 @@ namespace Orchard.Alias.Implementation.Map {
if (match == null) {
// Get the shortest path available to ensure the "home" alias is always taken if present.
var foundPath = focus.Paths.Keys.OrderBy(x => x).FirstOrDefault();
var foundPath = focus.Paths.Keys.OrderBy(x => x.Length).FirstOrDefault();
if (foundPath != null) {
// Here the deepest match is being created, which will be populated as it rises back up the stack, but save the path here.
// Within this function it's used to count how many items match so we get the best one; but when it's returned
@ -194,4 +194,4 @@ namespace Orchard.Alias.Implementation.Map {
}
}
}
}