Fixing that stylesheets having a protocol-relative URL caused exception when building shape alternate names

This commit is contained in:
Lombiq
2016-04-28 01:55:36 +02:00
committed by Zoltán Lehóczky
parent 2b3451cd13
commit 77f3a031c5

View File

@@ -43,6 +43,9 @@ namespace Orchard.DisplayManagement.Descriptors.ResourceBindingStrategy {
if (Uri.IsWellFormedUriString(fileName, UriKind.Absolute)
|| (fileName.StartsWith("//", StringComparison.InvariantCulture)
&& Uri.IsWellFormedUriString("http:" + fileName, UriKind.Absolute))) {
if (fileName.StartsWith("//", StringComparison.InvariantCulture)) {
fileName = "http:" + fileName;
}
var uri = new Uri(fileName);
shapeName = uri.Authority + "$" + uri.AbsolutePath + "$" + uri.Query;
}