prevent stylesheet resources from being duplicated
This commit is contained in:
parent
2dd1d7e926
commit
2eac9c3795
@ -623,7 +623,7 @@
|
||||
}
|
||||
|
||||
// ensure resource does not exist already
|
||||
if (!pageresources.Exists(item => item.Url.ToLower() == resource.Url.ToLower()))
|
||||
if (!pageresources.Exists(item => Utilities.GetUrlPath(item.Url).ToLower() == Utilities.GetUrlPath(resource.Url).ToLower()))
|
||||
{
|
||||
pageresources.Add(resource.Clone(level, name, fingerprint));
|
||||
}
|
||||
|
@ -764,7 +764,7 @@
|
||||
}
|
||||
|
||||
// ensure resource does not exist already
|
||||
if (!pageresources.Exists(item => item.Url.ToLower() == resource.Url.ToLower()))
|
||||
if (!pageresources.Exists(item => Utilities.GetUrlPath(item.Url).ToLower() == Utilities.GetUrlPath(resource.Url).ToLower()))
|
||||
{
|
||||
pageresources.Add(resource.Clone(level, name, fingerprint));
|
||||
}
|
||||
|
@ -491,6 +491,15 @@ namespace Oqtane.Shared
|
||||
return querystring;
|
||||
}
|
||||
|
||||
public static string GetUrlPath(string url)
|
||||
{
|
||||
if (url.Contains("?"))
|
||||
{
|
||||
url = url.Substring(0, url.IndexOf("?"));
|
||||
}
|
||||
return url;
|
||||
}
|
||||
|
||||
public static string LogMessage(object @class, string message)
|
||||
{
|
||||
return $"[{@class.GetType()}] {message}";
|
||||
|
Loading…
x
Reference in New Issue
Block a user