i2psnark: Escape chars not escaped by browsers

This commit is contained in:
zzz
2018-02-01 14:17:57 +00:00
parent cccf76cc78
commit 81713a0cab

View File

@ -2529,7 +2529,8 @@ public class SnarkManager implements CompleteListener, ClientApp {
return DataHelper.escapeHTML(snark.getBaseName());
StringBuilder buf = new StringBuilder(256);
String base = DataHelper.escapeHTML(storage.getBaseName());
buf.append("<a href=\"").append(_contextPath).append('/').append(base);
String enc = base.replace("[", "%5B").replace("]", "%5D").replace("|", "%7C");
buf.append("<a href=\"").append(_contextPath).append('/').append(enc);
if (meta.getFiles() != null || !storage.complete())
buf.append('/');
buf.append("\">").append(base).append("</a>");