From bd2fc71dc589498fd77b4b46df50c74fa8411fc2 Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Tue, 2 Feb 2016 11:55:24 +0100 Subject: [PATCH] U4-7276 When creating folders in the "Partials" view folder a YSOD appears (Umbraco 7.3 and 7.4) --- .../umbraco/create/PartialViewTasksBase.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/create/PartialViewTasksBase.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/create/PartialViewTasksBase.cs index 042bf312d1..abb1299507 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/create/PartialViewTasksBase.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/create/PartialViewTasksBase.cs @@ -1,5 +1,6 @@ using System; using System.IO; +using System.Web; using Umbraco.Core.CodeAnnotations; using Umbraco.Core.Configuration; using Umbraco.Core.IO; @@ -52,7 +53,7 @@ namespace umbraco if (IsPartialViewMacro == false) { var attempt = fileService.CreatePartialView(model, snippetName, User.Id); - _returnUrl = string.Format("settings/views/EditView.aspx?treeType=partialViews&file={0}", model.Path.TrimStart('/')); + _returnUrl = string.Format("settings/views/EditView.aspx?treeType=partialViews&file={0}", HttpUtility.UrlEncode(model.Path.TrimStart('/').Replace("\\", "/"))); return attempt.Success; } else @@ -68,7 +69,7 @@ namespace umbraco macroService.Save(new Macro(attempt.Result.Alias, attempt.Result.Alias) { ScriptPath = virtualPath }); } - _returnUrl = string.Format("settings/views/EditView.aspx?treeType=partialViewMacros&file={0}", model.Path.TrimStart('/')); + _returnUrl = string.Format("settings/views/EditView.aspx?treeType=partialViewMacros&file={0}", HttpUtility.UrlEncode(model.Path.TrimStart('/').Replace("\\", "/"))); return attempt.Success; }