From 00ffe7a6b3dc977113a4882c8bf045b395fce922 Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Tue, 9 Aug 2022 16:27:46 +0200 Subject: [PATCH] Only expose the filename when uploading content types (#12813) --- .../Controllers/ContentTypeController.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Web.BackOffice/Controllers/ContentTypeController.cs b/src/Umbraco.Web.BackOffice/Controllers/ContentTypeController.cs index 6dc0824efc..b12f9a6cca 100644 --- a/src/Umbraco.Web.BackOffice/Controllers/ContentTypeController.cs +++ b/src/Umbraco.Web.BackOffice/Controllers/ContentTypeController.cs @@ -571,7 +571,7 @@ public class ContentTypeController : ContentTypeControllerBase [Authorize(Policy = AuthorizationPolicies.TreeAccessDocumentTypes)] public IActionResult Import(string file) { - var filePath = Path.Combine(_hostingEnvironment.MapPathContentRoot(Constants.SystemDirectories.Data), file); + var filePath = Path.Combine(_hostingEnvironment.MapPathContentRoot(Constants.SystemDirectories.TempFileUploads), file); if (string.IsNullOrEmpty(file) || !System.IO.File.Exists(filePath)) { return NotFound(); @@ -623,10 +623,10 @@ public class ContentTypeController : ContentTypeControllerBase if (ext.InvariantEquals("udt")) { - model.TempFileName = Path.Combine(root, fileName); + model.TempFileName = fileName; var xd = new XmlDocument { XmlResolver = null }; - xd.Load(model.TempFileName); + xd.Load(Path.Combine(root, fileName)); model.Alias = xd.DocumentElement?.SelectSingleNode("//DocumentType/Info/Alias")?.FirstChild?.Value; model.Name = xd.DocumentElement?.SelectSingleNode("//DocumentType/Info/Name")?.FirstChild?.Value;