Skip to content

Commit

Permalink
Fixed bug where explicit URL nodes and non-clickable nodes were being…
Browse files Browse the repository at this point in the history
… included in the route matching logic. Routes should never match in these cases.
  • Loading branch information
NightOwl888 committed Feb 28, 2014
1 parent 819f5ed commit 354699e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/MvcSiteMapProvider/MvcSiteMapProvider/SiteMapNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,14 @@ public override RouteData GetRouteData(HttpContextBase httpContext)
/// <returns><c>true</c> if the route matches this node's RouteValues collection; otherwise <c>false</c>.</returns>
public override bool MatchesRoute(IDictionary<string, object> routeValues)
{
// If not clickable, we never want to match the node.
if (!this.Clickable)
return false;

// If URL is set explicitly, we should never match based on route values.
if (!string.IsNullOrEmpty(this.UnresolvedUrl))
return false;

return this.RouteValues.MatchesRoute(routeValues);
}

Expand Down

0 comments on commit 354699e

Please sign in to comment.