i2psnark: Another escaping fix

This commit is contained in:
zzz
2019-11-08 14:48:30 +00:00
parent 2738b3d29c
commit dfc533b6e8

View File

@ -87,6 +87,7 @@ class URIUtil
case ':': case ':':
case '[': case '[':
case ']': case ']':
case '&':
buf=new StringBuilder(path.length()*2); buf=new StringBuilder(path.length()*2);
break loop; break loop;
default: default:
@ -151,6 +152,10 @@ class URIUtil
case ']': case ']':
buf.append("%5D"); buf.append("%5D");
continue; continue;
// not strictly required but this is probably HTML output
case '&':
buf.append("%26");
continue;
default: default:
if (c <= 0x1f) // includes negative if (c <= 0x1f) // includes negative
toHex(c,buf); toHex(c,buf);
@ -204,6 +209,9 @@ class URIUtil
case ']': case ']':
buf.append("%5D"); buf.append("%5D");
continue; continue;
case '&':
buf.append("%26");
continue;
default: default:
if (c <= 0x1f || (c >= 0x7f && c <= 0x9f) || Character.isSpaceChar(c)) if (c <= 0x1f || (c >= 0x7f && c <= 0x9f) || Character.isSpaceChar(c))
toHex(c,buf); toHex(c,buf);