Fixed issue with file links: filenames that were already encoded were encoded a second time.
This commit is contained in:
parent
b95f6342a1
commit
24646bd331
3 changed files with 7 additions and 5 deletions
|
@ -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")]
|
||||
|
|
|
@ -884,7 +884,8 @@ namespace ScrewTurn.Wiki {
|
|||
/// <param name="startIndex">The index where to start working.</param>
|
||||
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);
|
||||
}
|
||||
|
|
|
@ -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";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue