diff --git a/AssemblyVersion.cs b/AssemblyVersion.cs index ebe12b6..1452f6b 100644 --- a/AssemblyVersion.cs +++ b/AssemblyVersion.cs @@ -16,5 +16,5 @@ using System.Reflection; // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("3.0.1.423")] -[assembly: AssemblyFileVersion("3.0.1.423")] +[assembly: AssemblyVersion("3.0.1.424")] +[assembly: AssemblyFileVersion("3.0.1.424")] diff --git a/Core/Formatter.cs b/Core/Formatter.cs index f0464dc..8111be6 100644 --- a/Core/Formatter.cs +++ b/Core/Formatter.cs @@ -884,7 +884,8 @@ namespace ScrewTurn.Wiki { /// The index where to start working. private static void EncodeFilename(StringBuilder buffer, int startIndex) { // 1. Find end of the filename (first pipe or closed square bracket) - // 2. Encode the string + // 2. Decode the string, so that it does not break if it was already encoded + // 3. Encode the string string allData = buffer.ToString(); @@ -892,7 +893,8 @@ namespace ScrewTurn.Wiki { if(endIndex > startIndex) { int len = endIndex - startIndex; // {, : and } are used in snippets which are useful in links - string value = Tools.UrlEncode(allData.Substring(startIndex, len)).Replace("%7b", "{").Replace("%7B", "{").Replace("%7d", "}").Replace("%7D", "}").Replace("%3a", ":").Replace("%3A", ":"); + string input = Tools.UrlDecode(allData.Substring(startIndex, len)); + string value = Tools.UrlEncode(input).Replace("%7b", "{").Replace("%7B", "{").Replace("%7d", "}").Replace("%7D", "}").Replace("%3a", ":").Replace("%3A", ":"); buffer.Remove(startIndex, len); buffer.Insert(startIndex, value); } diff --git a/WebApplication/FileManager.ascx.cs b/WebApplication/FileManager.ascx.cs index 5c03f3e..77690b8 100644 --- a/WebApplication/FileManager.ascx.cs +++ b/WebApplication/FileManager.ascx.cs @@ -193,7 +193,7 @@ namespace ScrewTurn.Wiki { row["Type"] = "F"; row["Name"] = GetItemName(s); row["Size"] = Tools.BytesToString(details.Size); - row["WikiMarkupLink"] = "{UP}" + Tools.UrlEncode(s); + row["WikiMarkupLink"] = "{UP}" + s; if(canDownload) { row["Link"] = "GetFile.aspx?File=" + Tools.UrlEncode(s).Replace("'", "'") + "&AsStreamAttachment=1&Provider=" + provider.GetType().FullName + "&NoHit=1";