From d0e7c09ba504b16ac793d3018a3bd55d389a32c8 Mon Sep 17 00:00:00 2001 From: Sipke Schoorstra Date: Mon, 14 Sep 2015 13:21:57 +0100 Subject: [PATCH] Updated AliasMap Ordering by key Length rather than key value. --- .../Modules/Orchard.Alias/Implementation/Map/AliasMap.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Orchard.Web/Modules/Orchard.Alias/Implementation/Map/AliasMap.cs b/src/Orchard.Web/Modules/Orchard.Alias/Implementation/Map/AliasMap.cs index 8df2be595..7a2be0e51 100644 --- a/src/Orchard.Web/Modules/Orchard.Alias/Implementation/Map/AliasMap.cs +++ b/src/Orchard.Web/Modules/Orchard.Alias/Implementation/Map/AliasMap.cs @@ -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 { } } -} \ No newline at end of file +}