Framework/Resources: Fixing a regression with Style.Include, so it supports paths with a query string again, fixes #8231

This commit is contained in:
Lombiq
2019-08-15 23:59:46 +02:00
committed by Benedek Farkas
parent 638a588101
commit d2aa33d494
2 changed files with 2 additions and 2 deletions

View File

@@ -307,7 +307,7 @@ namespace Orchard.UI.Resources {
private string GetPhysicalPath(string url) {
if (!String.IsNullOrEmpty(url) && !Uri.IsWellFormedUriString(url, UriKind.Absolute) && !url.StartsWith("//")) {
if (VirtualPathUtility.IsAbsolute(url) || VirtualPathUtility.IsAppRelative(url)) {
return HostingEnvironment.MapPath(url);
return HostingEnvironment.MapPath(url.Split(new[] { '?' })[0]);
}
if (!String.IsNullOrEmpty(BasePath)) {
return HostingEnvironment.MapPath(VirtualPathUtility.Combine(BasePath, url));

View File

@@ -53,7 +53,7 @@ namespace Orchard.UI.Resources {
private static string ToPhysicalPath(string resourcePath) {
if (!String.IsNullOrEmpty(resourcePath) && (VirtualPathUtility.IsAppRelative(resourcePath) || VirtualPathUtility.IsAbsolute(resourcePath)) && !Uri.IsWellFormedUriString(resourcePath, UriKind.Absolute) && !resourcePath.StartsWith("//")) {
return HostingEnvironment.MapPath(resourcePath);
return HostingEnvironment.MapPath(resourcePath.Split(new[] { '?' })[0]);
}
return null;
}