From be0d843c865869ae4797c90659c1c5db0e93ae4d Mon Sep 17 00:00:00 2001 From: sebastiaan Date: Fri, 31 Aug 2012 11:00:38 -0200 Subject: [PATCH] Fixes U4-419 Improved editing xslt/razor/ruby/python files in subfolders a little bit (it now actually works) Still needs more work to make it safer (especially entering backslashes will give YSODs and sometimes when you move to a different folder the old file stays behind) --- .../umbraco/developer/Python/editPython.aspx.cs | 4 +--- .../umbraco/developer/Xslt/editXslt.aspx.cs | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Python/editPython.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Python/editPython.aspx.cs index c8530145d6..b338248582 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Python/editPython.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Python/editPython.aspx.cs @@ -79,9 +79,7 @@ namespace umbraco.cms.presentation.developer // validate extension IOHelper.ValidateFileExtension(file, validScriptingExtensions()); - //// we need to move the full path and then the preceeding slash - // The textbox only needs to show the requested file (and parentfolders) - pythonFileName.Text = Request.QueryString["file"]; + pythonFileName.Text = file.Replace(IOHelper.MapPath(SystemDirectories.MacroScripts), "").Substring(1).Replace(@"\", "/"); StreamReader SR; string S; diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Xslt/editXslt.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Xslt/editXslt.aspx.cs index a761eac9d9..a3ef75b31e 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Xslt/editXslt.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Xslt/editXslt.aspx.cs @@ -112,7 +112,7 @@ namespace umbraco.cms.presentation.developer IOHelper.ValidateFileExtension(file, new List() { "xslt", "xsl" }); - xsltFileName.Text = file.Replace(IOHelper.MapPath(SystemDirectories.Xslt), "").Substring(1); + xsltFileName.Text = file.Replace(IOHelper.MapPath(SystemDirectories.Xslt), "").Substring(1).Replace(@"\", "/"); StreamReader SR; string S;