safer encode

not just hash encoding, but also other characters. Has no adverse side
effects, as seen in the image in the PR.
This commit is contained in:
wforums 2015-11-28 08:57:41 +01:00
parent c7ff0f3680
commit e577bef402

View file

@ -69,8 +69,8 @@ public override UploadResult Upload(Stream stream, string fileName)
// Original, unencoded path. Necessary for shared files
string path = URLHelpers.CombineURL(Path, fileName);
// Encoded path (# replaced by %23), necessary when sent in the URL
string encodedPath = URLHelpers.CombineURL(Path, fileName.Replace("#", "%23"));
// Encoded path, necessary when sent in the URL
string encodedPath = URLHelpers.CombineURL(Path, URLHelpers.URLEncode(fileName));
string url = URLHelpers.CombineURL(Host, "remote.php/webdav", encodedPath);
url = URLHelpers.FixPrefix(url);