Skip to content

Commit

Permalink
Changed from StringComparison.InvariantCulture to StringComparison.Or…
Browse files Browse the repository at this point in the history
…dinal for symbolic data as per Microsoft's recommendation https://msdn.microsoft.com/en-us/library/dd465121(v=vs.110).aspx. This will also help with compatibility with DNX core.
  • Loading branch information
NightOwl888 committed Oct 14, 2015
1 parent 4c3a73d commit a04df55
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public virtual bool UseTitleIfDescriptionNotProvided

public virtual bool AppliesTo(string builderSetName)
{
return this.instanceName.Equals(builderSetName, StringComparison.InvariantCulture);
return this.instanceName.Equals(builderSetName, StringComparison.Ordinal);
}

#endregion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ protected virtual bool MatchesRouteValue(string key, object value)

protected virtual bool MatchesValue(string key, object value)
{
return this[key].ToString().Equals(value.ToString(), StringComparison.InvariantCultureIgnoreCase);
return this[key].ToString().Equals(value.ToString(), StringComparison.OrdinalIgnoreCase);
}

protected virtual bool IsEmptyValue(object value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public bool IsVisible(ISiteMapNode node, IDictionary<string, object> sourceMetad

public bool AppliesTo(string providerName)
{
return this.instanceName.Equals(providerName, StringComparison.InvariantCulture);
return this.instanceName.Equals(providerName, StringComparison.Ordinal);
}

#endregion
Expand Down
2 changes: 1 addition & 1 deletion src/MvcSiteMapProvider/MvcSiteMapProvider/SiteMap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,7 @@ protected virtual void ThrowIfHttpMethodInvalid(ISiteMapNode node)
if (string.IsNullOrEmpty(node.HttpMethod) ||
(!EnumHelper.TryParse<HttpVerbs>(node.HttpMethod, true, out verbs) &&
!node.HttpMethod.Equals("*") &&
!node.HttpMethod.Equals("Request", StringComparison.InvariantCultureIgnoreCase)))
!node.HttpMethod.Equals("Request", StringComparison.OrdinalIgnoreCase)))
{
var allowedVerbs = string.Join(Environment.NewLine, Enum.GetNames(typeof(HttpVerbs))) + Environment.NewLine + "Request" + Environment.NewLine + "*";
throw new MvcSiteMapException(string.Format(Resources.Messages.SiteMapNodeHttpMethodInvalid, node.Key, node.Title, node.HttpMethod, allowedVerbs));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public override string HttpMethod
{
bool useRequest = this.node == null ||
string.Equals(this.node.HttpMethod, "*") ||
string.Equals(this.node.HttpMethod, "request", StringComparison.InvariantCultureIgnoreCase);
string.Equals(this.node.HttpMethod, "request", StringComparison.OrdinalIgnoreCase);
if (!useRequest)
{
return string.IsNullOrEmpty(this.node.HttpMethod)
Expand Down
2 changes: 1 addition & 1 deletion src/MvcSiteMapProvider/MvcSiteMapProvider/Web/UrlPath.cs
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ public bool IsExternalUrl(string url, HttpContextBase httpContext)
{
var publicFacingUrl = this.GetPublicFacingUrl(httpContext);
var isDifferentHost = !uri.Host.ToLowerInvariant().Equals(publicFacingUrl.Host.ToLowerInvariant());
var isDifferentVirtualApplication = !uri.AbsolutePath.StartsWith(httpContext.Request.ApplicationPath, StringComparison.InvariantCultureIgnoreCase);
var isDifferentVirtualApplication = !uri.AbsolutePath.StartsWith(httpContext.Request.ApplicationPath, StringComparison.OrdinalIgnoreCase);

return (isDifferentHost || isDifferentVirtualApplication);
}
Expand Down

0 comments on commit a04df55

Please sign in to comment.