From 5bee398d09adb0023d676496efc3933a381c8df6 Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Fri, 27 Jun 2014 17:22:51 +0200 Subject: [PATCH] #U4-3838 fixed Due in version 7.1.5 Fixes ContentService Copy uses IOHelper.MapPath but should use fs.GetFullPath and a few other instances where IOHelper was used --- src/Umbraco.Core/Persistence/Repositories/ContentRepository.cs | 2 +- src/Umbraco.Core/Persistence/Repositories/MemberRepository.cs | 2 +- src/Umbraco.Web/PropertyEditors/FileUploadPropertyEditor.cs | 2 +- src/Umbraco.Web/PropertyEditors/ImageCropperPropertyEditor.cs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Umbraco.Core/Persistence/Repositories/ContentRepository.cs b/src/Umbraco.Core/Persistence/Repositories/ContentRepository.cs index b38b19a2d8..08c159481b 100644 --- a/src/Umbraco.Core/Persistence/Repositories/ContentRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/ContentRepository.cs @@ -498,7 +498,7 @@ namespace Umbraco.Core.Persistence.Repositories { if (property.PropertyType.PropertyEditorAlias == Constants.PropertyEditors.UploadFieldAlias && property.Value != null && string.IsNullOrEmpty(property.Value.ToString()) == false - && fs.FileExists(IOHelper.MapPath(property.Value.ToString()))) + && fs.FileExists(fs.GetRelativePath(property.Value.ToString()))) { var relativeFilePath = fs.GetRelativePath(property.Value.ToString()); var parentDirectory = System.IO.Path.GetDirectoryName(relativeFilePath); diff --git a/src/Umbraco.Core/Persistence/Repositories/MemberRepository.cs b/src/Umbraco.Core/Persistence/Repositories/MemberRepository.cs index 595fcb033d..2bbb3439ca 100644 --- a/src/Umbraco.Core/Persistence/Repositories/MemberRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/MemberRepository.cs @@ -398,7 +398,7 @@ namespace Umbraco.Core.Persistence.Repositories { if (property.PropertyType.PropertyEditorAlias == uploadFieldAlias && string.IsNullOrEmpty(property.Value.ToString()) == false - && fs.FileExists(IOHelper.MapPath(property.Value.ToString()))) + && fs.FileExists(fs.GetRelativePath(property.Value.ToString()))) { var relativeFilePath = fs.GetRelativePath(property.Value.ToString()); var parentDirectory = System.IO.Path.GetDirectoryName(relativeFilePath); diff --git a/src/Umbraco.Web/PropertyEditors/FileUploadPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/FileUploadPropertyEditor.cs index 4934a457d8..28da565b9e 100644 --- a/src/Umbraco.Web/PropertyEditors/FileUploadPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/FileUploadPropertyEditor.cs @@ -71,7 +71,7 @@ namespace Umbraco.Web.PropertyEditors && x.Value != null && string.IsNullOrEmpty(x.Value.ToString()) == false)) { - if (fs.FileExists(IOHelper.MapPath(property.Value.ToString()))) + if (fs.FileExists(fs.GetRelativePath(property.Value.ToString()))) { var currentPath = fs.GetRelativePath(property.Value.ToString()); var propertyId = e.Copy.Properties.First(x => x.Alias == property.Alias).Id; diff --git a/src/Umbraco.Web/PropertyEditors/ImageCropperPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/ImageCropperPropertyEditor.cs index bb6aff2e95..468d039936 100644 --- a/src/Umbraco.Web/PropertyEditors/ImageCropperPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/ImageCropperPropertyEditor.cs @@ -89,7 +89,7 @@ namespace Umbraco.Web.PropertyEditors if (json["src"] != null && json["src"].ToString().IsNullOrWhiteSpace() == false) { - if (fs.FileExists(IOHelper.MapPath(json["src"].ToString()))) + if (fs.FileExists(fs.GetRelativePath(json["src"].ToString()))) { var currentPath = fs.GetRelativePath(json["src"].ToString()); var propertyId = e.Copy.Properties.First(x => x.Alias == property.Alias).Id;