From beeb28f390f6ec2ca0187fc8635fbbe6d4c61e63 Mon Sep 17 00:00:00 2001 From: Shannon Deminick Date: Tue, 15 Jan 2013 00:23:40 +0300 Subject: [PATCH] Fixes #U4-1467 --- src/Umbraco.Core/IO/PhysicalFileSystem.cs | 4 ++-- src/Umbraco.Tests/IO/IOHelperTest.cs | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) 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 ///