diff --git a/src/Umbraco.Core/IO/PhysicalFileSystem.cs b/src/Umbraco.Core/IO/PhysicalFileSystem.cs index 0e2f97bd7f..d121ffac73 100644 --- a/src/Umbraco.Core/IO/PhysicalFileSystem.cs +++ b/src/Umbraco.Core/IO/PhysicalFileSystem.cs @@ -17,8 +17,8 @@ namespace Umbraco.Core.IO public PhysicalFileSystem(string virtualRoot) { - _rootPath = System.Web.Hosting.HostingEnvironment.MapPath(virtualRoot); - _rootUrl = VirtualPathUtility.ToAbsolute(virtualRoot); + _rootPath = IOHelper.MapPath(virtualRoot); + _rootUrl = IOHelper.ResolveUrl(virtualRoot); } public PhysicalFileSystem(string rootPath, string rootUrl) diff --git a/src/Umbraco.Tests/IO/IOHelperTest.cs b/src/Umbraco.Tests/IO/IOHelperTest.cs index d23d5cba5f..9f8822fbff 100644 --- a/src/Umbraco.Tests/IO/IOHelperTest.cs +++ b/src/Umbraco.Tests/IO/IOHelperTest.cs @@ -13,6 +13,13 @@ namespace Umbraco.Tests.IO public class IOHelperTest { + [Test] + public void IOHelper_ResolveUrl() + { + var result = IOHelper.ResolveUrl("~/Scripts"); + Assert.AreEqual("/Scripts", result); + } + /// ///A test for MapPath verifying that HttpContext method (which includes vdirs) matches non-HttpContext method ///