From 056275711491e30946d090ba06b71fd25fa177d4 Mon Sep 17 00:00:00 2001 From: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com> Date: Wed, 22 Jan 2025 13:47:24 +0100 Subject: [PATCH] Replace paths, so they are equal on every OS (#18071) * Replace paths, so they are equal on every OS * Don't use Path.Combine --- .../Controllers/Security/BackOfficeGraphicsController.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Security/BackOfficeGraphicsController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Security/BackOfficeGraphicsController.cs index 39c71b3c55..11c9a36e25 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Security/BackOfficeGraphicsController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Security/BackOfficeGraphicsController.cs @@ -5,6 +5,7 @@ using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.StaticFiles; +using Microsoft.Extensions.FileProviders; using Microsoft.Extensions.Options; using Umbraco.Cms.Api.Management.Routing; using Umbraco.Cms.Core; @@ -55,8 +56,8 @@ public class BackOfficeGraphicsController : Controller private IActionResult HandleFileRequest(string virtualPath) { - var filePath = Path.Combine(Constants.SystemDirectories.Umbraco, virtualPath).TrimStart(Constants.CharArrays.Tilde); - var fileInfo = _webHostEnvironment.WebRootFileProvider.GetFileInfo(filePath); + var filePath = $"{Constants.SystemDirectories.Umbraco}/{virtualPath}".TrimStart(Constants.CharArrays.Tilde); + IFileInfo fileInfo = _webHostEnvironment.WebRootFileProvider.GetFileInfo(filePath); if (fileInfo.PhysicalPath is null) {