urldecode display name in WebDavStorage to close #792

This commit is contained in:
Philipp Crocoll
2019-12-16 12:18:02 +01:00
parent 69abcd0786
commit 97fb35db90

View File

@@ -447,10 +447,20 @@ public class WebDavStorage extends JavaFileStorageBase {
if (href.endsWith("/")) if (href.endsWith("/"))
href = href.substring(0, href.length()-1); href = href.substring(0, href.length()-1);
int lastIndex = href.lastIndexOf("/"); int lastIndex = href.lastIndexOf("/");
String displayName;
if (lastIndex >= 0) if (lastIndex >= 0)
return href.substring(lastIndex + 1); displayName = href.substring(lastIndex + 1);
else else
return href; displayName = href;
try {
displayName = java.net.URLDecoder.decode(displayName, UTF_8);
} catch (UnsupportedEncodingException e) {
}
return displayName;
} }
@Override @Override