```
return Uri.EscapeUriString(httpHomeUri.Uri.ToString());
```
This return statement was double encoding filename hence the extra
encoding on the "%" sign in the URL in clipboard.

filename is first encoded in this line:

```
httpHomeUri = new UriBuilder(URLHelpers.CombineURL(host, subFolderPath,
filename));
```
This commit is contained in:
Leo Lam 2015-01-12 01:48:24 -05:00
parent 85f2f73584
commit 166e4bd126

View file

@ -29,6 +29,7 @@ You should have received a copy of the GNU General Public License
using System.ComponentModel;
using System.Drawing.Design;
using System.IO;
using System.Web;
namespace ShareX.UploadersLib
{
@ -168,7 +169,7 @@ public string GetUriPath(string filename, string subFolderPath = null)
filename = Path.GetFileNameWithoutExtension(filename);
}
filename = URLHelpers.URLEncode(filename);
filename = HttpUtility.UrlEncode(filename);
if (subFolderPath == null)
{
@ -176,6 +177,7 @@ public string GetUriPath(string filename, string subFolderPath = null)
}
UriBuilder httpHomeUri;
var httpHomePath = GetHttpHomePath();
if (string.IsNullOrEmpty(httpHomePath))
@ -230,7 +232,7 @@ public string GetUriPath(string filename, string subFolderPath = null)
}
httpHomeUri.Scheme = BrowserProtocol.GetDescription();
return Uri.EscapeUriString(httpHomeUri.Uri.ToString());
return httpHomeUri.Uri.ToString();
}
public string GetFtpPath(string filemame)