mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 11:44:58 +08:00
Fixes #6113 : Anchor custom link on homepage produces bad href
This commit is contained in:
@@ -93,16 +93,15 @@ namespace Orchard.Core.Navigation.Services {
|
||||
var schemes = new[] { "http", "https", "tel", "mailto" };
|
||||
if (!string.IsNullOrEmpty(url) && _urlHelper.RequestContext.HttpContext != null &&
|
||||
!(url.StartsWith("/") || schemes.Any(scheme => url.StartsWith(scheme + ":")))) {
|
||||
if (url.StartsWith("~/")) {
|
||||
|
||||
if (!String.IsNullOrEmpty(_shellSettings.RequestUrlPrefix)) {
|
||||
url = _shellSettings.RequestUrlPrefix + "/" + url.Substring(2);
|
||||
}
|
||||
else {
|
||||
url = url.Substring(2);
|
||||
}
|
||||
}
|
||||
if (!url.StartsWith("#")) {
|
||||
if (url.StartsWith("~/")) {
|
||||
if (!String.IsNullOrEmpty(_shellSettings.RequestUrlPrefix)) {
|
||||
url = _shellSettings.RequestUrlPrefix + "/" + url.Substring(2);
|
||||
}
|
||||
else {
|
||||
url = url.Substring(2);
|
||||
}
|
||||
}
|
||||
var appPath = _urlHelper.RequestContext.HttpContext.Request.ApplicationPath;
|
||||
if (appPath == "/")
|
||||
appPath = "";
|
||||
|
Reference in New Issue
Block a user