Skip to content

Commit 7083890

Browse files
donkerbdukes
authored andcommitted
Make sure the extension checking ignores a querystring
1 parent 068427c commit 7083890

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

DNN Platform/DotNetNuke.Web.Client/Controls/DnnCssInclude.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,17 @@ public DnnCssInclude(IClientResourceController clientResourceController)
4242
/// <inheritdoc />
4343
protected override void OnLoad(EventArgs e)
4444
{
45+
var filePath = this.FilePath;
46+
if (filePath.IndexOf('?') > 0)
47+
{
48+
filePath = filePath.Substring(0, filePath.IndexOf('?'));
49+
}
50+
4551
var extension = ".css";
46-
var hit = this.FilePath.LastIndexOf('.');
52+
var hit = filePath.LastIndexOf('.');
4753
if (hit > 0)
4854
{
49-
extension = this.FilePath.Substring(hit).ToLowerInvariant();
55+
extension = filePath.Substring(hit).ToLowerInvariant();
5056
}
5157

5258
switch (extension)

0 commit comments

Comments
 (0)