Skip to content

Commit

Permalink
Fixed FilteredSiteMapVisibilityProvider so it will ignore white-space…
Browse files Browse the repository at this point in the history
… between the keywords and separator characters.
  • Loading branch information
NightOwl888 committed Feb 9, 2014
1 parent 2c2a6cd commit e625905
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace MvcSiteMapProvider
Expand Down Expand Up @@ -57,8 +58,9 @@ public override bool IsVisible(ISiteMapNode node, IDictionary<string, object> so
// Chop off the namespace
htmlHelper = htmlHelper.Substring(htmlHelper.LastIndexOf(".") + 1);

// Get the keywords
var visibilityKeywords = visibility.Split(new[] { ',', ';' }, StringSplitOptions.RemoveEmptyEntries);
// Get the keywords and trim any white-spaces
var visibilityKeywords = visibility.Split(new[] { ',', ';' }, StringSplitOptions.RemoveEmptyEntries)
.Select(k => k.Trim()).ToList();

// All set. Now parse the visibility variable.
foreach (string visibilityKeyword in visibilityKeywords)
Expand Down

0 comments on commit e625905

Please sign in to comment.