diff --git a/src/Umbraco.Core/Services/FileServiceOperationBase.cs b/src/Umbraco.Core/Services/FileServiceOperationBase.cs index 703465a1b3..e7b392d949 100644 --- a/src/Umbraco.Core/Services/FileServiceOperationBase.cs +++ b/src/Umbraco.Core/Services/FileServiceOperationBase.cs @@ -82,6 +82,11 @@ public abstract class FileServiceOperationBase> HandleCreateAsync(string name, string? parentPath, string? content, Guid userKey) { + if (name.Contains('/')) + { + return Attempt.FailWithStatus(InvalidName, default); + } + using ICoreScope scope = ScopeProvider.CreateCoreScope(); var path = GetFilePath(parentPath, name); @@ -148,6 +153,11 @@ public abstract class FileServiceOperationBase> HandleRenameAsync(string path, string newName, Guid userKey) { + if (newName.Contains('/')) + { + return Attempt.FailWithStatus(InvalidName, default); + } + using ICoreScope scope = ScopeProvider.CreateCoreScope(); TEntity? entity = Repository.Get(path);