Adding more field tokens

--HG--
branch : 1.x
This commit is contained in:
Sebastien Ros
2012-05-03 14:51:40 -07:00
parent c5f32cfc84
commit 89118483e3
2 changed files with 9 additions and 3 deletions
@@ -39,11 +39,17 @@ namespace Orchard.Mvc.Extensions {
// remove any application path from the base url
var applicationPath = urlHelper.RequestContext.HttpContext.Request.ApplicationPath ?? String.Empty;
// ~/foo/bar => /foo/bar
if (url.StartsWith("~/", StringComparison.OrdinalIgnoreCase)) {
url = url.Substring(1);
}
// orchardlocal/foo/bar => /orchardlocal/foo/bar
if(!url.StartsWith("/")) {
url = "/" + url;
}
// /orchardlocal/foo/bar => foo/bar
if (url.StartsWith(applicationPath, StringComparison.OrdinalIgnoreCase)) {
url = url.Substring(applicationPath.Length);