Template
1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo synced 2024-11-27 20:26:09 +01:00

Escape elems as well

This commit is contained in:
j. mccann 2020-02-16 01:48:49 -05:00
parent 55cd4a6248
commit 8bf49596fe

View file

@ -28,6 +28,10 @@ func URLJoin(base string, elems ...string) string {
// We do need to escape special chars here or else they can be silently discarded
// in the ResolveReference call below
base = PathEscapeSegments(base)
for k, v := range elems {
elems[k] = PathEscapeSegments(v)
}
if !strings.HasSuffix(base, "/") {
base += "/"
}