From 0bec92e87e8f6f0389a4291a9b2f7fd39cab199c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Vesely=CC=81?= Date: Wed, 10 May 2023 16:42:14 +0200 Subject: [PATCH] FileService backslash fix --- Oqtane.Client/Services/FileService.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Oqtane.Client/Services/FileService.cs b/Oqtane.Client/Services/FileService.cs index 584e618b..3fef5c6e 100644 --- a/Oqtane.Client/Services/FileService.cs +++ b/Oqtane.Client/Services/FileService.cs @@ -1,3 +1,4 @@ +using System; using System.Collections.Generic; using System.Linq; using System.Net; @@ -29,9 +30,9 @@ namespace Oqtane.Services public async Task> GetFilesAsync(int siteId, string folderPath) { - if (!(folderPath.EndsWith(System.IO.Path.DirectorySeparatorChar) || folderPath.EndsWith(System.IO.Path.AltDirectorySeparatorChar))) + if (!(string.IsNullOrEmpty(folderPath) || folderPath.EndsWith(System.IO.Path.DirectorySeparatorChar) || folderPath.EndsWith(System.IO.Path.AltDirectorySeparatorChar))) { - folderPath = Utilities.PathCombine(folderPath, System.IO.Path.DirectorySeparatorChar.ToString()); + folderPath = Utilities.UrlCombine(folderPath) + "/"; } var path = WebUtility.UrlEncode(folderPath);