mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
#20439: Added support for urls using the "mailto" and "tel" schemes.
Work Item: 20439
This commit is contained in:

committed by
Sipke Schoorstra

parent
410c058166
commit
e2c2473115
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user