mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
fix Url rule provider to work on rooted web sites
--HG-- branch : dev
This commit is contained in:
@@ -23,10 +23,10 @@ namespace Orchard.Widgets.RuleEngine {
|
||||
appPath = "";
|
||||
url = string.Format("{0}/{1}", appPath, url);
|
||||
}
|
||||
if (!url.Contains("?") && url.EndsWith("/"))
|
||||
if (url != "/" && !url.Contains("?") && url.EndsWith("/"))
|
||||
url = url.TrimEnd('/');
|
||||
ruleContext.Result = url.EndsWith("*")
|
||||
? context.Request.RawUrl.ToUpperInvariant().StartsWith(url.ToUpperInvariant())
|
||||
? context.Request.Path.ToUpperInvariant().StartsWith(url.ToUpperInvariant())
|
||||
: context.Request.Path.ToUpperInvariant() == url.ToUpperInvariant();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user