Skip to content

Commit 76fc3f8

Browse files
authored
Fix for rooted UNC paths (#11982)
1 parent f1c83fb commit 76fc3f8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Umbraco.Infrastructure/DependencyInjection/UmbracoBuilder.FileSystems.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using System.IO;
12
using Microsoft.Extensions.DependencyInjection;
23
using Microsoft.Extensions.Logging;
34
using Microsoft.Extensions.Options;
@@ -49,7 +50,7 @@ internal static IUmbracoBuilder AddFileSystems(this IUmbracoBuilder builder)
4950
ILogger<PhysicalFileSystem> logger = factory.GetRequiredService<ILogger<PhysicalFileSystem>>();
5051
GlobalSettings globalSettings = factory.GetRequiredService<IOptions<GlobalSettings>>().Value;
5152

52-
var rootPath = hostingEnvironment.MapPathWebRoot(globalSettings.UmbracoMediaPhysicalRootPath);
53+
var rootPath = Path.IsPathRooted(globalSettings.UmbracoMediaPhysicalRootPath) ? globalSettings.UmbracoMediaPhysicalRootPath : hostingEnvironment.MapPathWebRoot(globalSettings.UmbracoMediaPhysicalRootPath);
5354
var rootUrl = hostingEnvironment.ToAbsolute(globalSettings.UmbracoMediaPath);
5455
return new PhysicalFileSystem(ioHelper, hostingEnvironment, logger, rootPath, rootUrl);
5556
});

0 commit comments

Comments
 (0)