mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-08-20 07:23:59 +08:00
Updated AliasMap
Ordering by key Length rather than key value.
This commit is contained in:
parent
8ca6c3367a
commit
d0e7c09ba5
@ -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 {
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user