#20439: Added support for urls using the "mailto" and "tel" schemes.

Work Item: 20439
This commit is contained in:
Brett Morrison
2014-01-23 15:39:45 +01:00
committed by Sipke Schoorstra
parent 410c058166
commit e2c2473115

View File

@@ -85,8 +85,9 @@ namespace Orchard.Core.Navigation.Services {
? menuItemUrl
: _urlHelper.RouteUrl(routeValueDictionary);
var schemes = new[] { "http", "https", "tel", "mailto" };
if (!string.IsNullOrEmpty(url) && _urlHelper.RequestContext.HttpContext != null &&
!(url.StartsWith("http://") || url.StartsWith("https://") || url.StartsWith("/"))) {
!(url.StartsWith("/") || schemes.Any(scheme => url.StartsWith(scheme + ":")))) {
if (url.StartsWith("~/")) {
url = url.Substring(2);
}