From 8d3d2180673b5daacdcf2500d64b83ee1ac563da Mon Sep 17 00:00:00 2001 From: sbwalker Date: Thu, 29 Jun 2023 12:24:20 -0400 Subject: [PATCH] handle paths during Folder add/update --- Oqtane.Server/Controllers/FolderController.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Oqtane.Server/Controllers/FolderController.cs b/Oqtane.Server/Controllers/FolderController.cs index 8c805e5e..6914aac7 100644 --- a/Oqtane.Server/Controllers/FolderController.cs +++ b/Oqtane.Server/Controllers/FolderController.cs @@ -124,7 +124,10 @@ namespace Oqtane.Controllers Folder parent = _folders.GetFolder(folder.ParentId.Value); folder.Path = Utilities.UrlCombine(parent.Path, folder.Name); } - folder.Path = folder.Path + "/"; + if (!folder.Path.EndsWith("/")) + { + folder.Path = folder.Path + "/"; + } folder = _folders.AddFolder(folder); _syncManager.AddSyncEvent(_alias.TenantId, EntityNames.Folder, folder.FolderId, SyncEventActions.Create); _logger.Log(LogLevel.Information, this, LogFunction.Create, "Folder Added {Folder}", folder); @@ -166,7 +169,10 @@ namespace Oqtane.Controllers Folder parent = _folders.GetFolder(folder.ParentId.Value); folder.Path = Utilities.UrlCombine(parent.Path, folder.Name); } - folder.Path = folder.Path + "/"; + if (!folder.Path.EndsWith("/")) + { + folder.Path = folder.Path + "/"; + } Folder _folder = _folders.GetFolder(id, false); if (_folder.Path != folder.Path && Directory.Exists(_folders.GetFolderPath(_folder)))