fix Url rule provider to work on rooted web sites

--HG--
branch : dev
This commit is contained in:
Renaud Paquay
2010-10-22 00:23:42 -07:00
parent db669c67b6
commit 5803922b49

View File

@@ -23,10 +23,10 @@ namespace Orchard.Widgets.RuleEngine {
appPath = ""; appPath = "";
url = string.Format("{0}/{1}", appPath, url); url = string.Format("{0}/{1}", appPath, url);
} }
if (!url.Contains("?") && url.EndsWith("/")) if (url != "/" && !url.Contains("?") && url.EndsWith("/"))
url = url.TrimEnd('/'); url = url.TrimEnd('/');
ruleContext.Result = url.EndsWith("*") ruleContext.Result = url.EndsWith("*")
? context.Request.RawUrl.ToUpperInvariant().StartsWith(url.ToUpperInvariant()) ? context.Request.Path.ToUpperInvariant().StartsWith(url.ToUpperInvariant())
: context.Request.Path.ToUpperInvariant() == url.ToUpperInvariant(); : context.Request.Path.ToUpperInvariant() == url.ToUpperInvariant();
} }
} }