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