mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-29 10:07:43 +01:00
Escape elems as well
This commit is contained in:
parent
55cd4a6248
commit
8bf49596fe
1 changed files with 4 additions and 0 deletions
|
@ -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
|
// We do need to escape special chars here or else they can be silently discarded
|
||||||
// in the ResolveReference call below
|
// in the ResolveReference call below
|
||||||
base = PathEscapeSegments(base)
|
base = PathEscapeSegments(base)
|
||||||
|
for k, v := range elems {
|
||||||
|
elems[k] = PathEscapeSegments(v)
|
||||||
|
}
|
||||||
|
|
||||||
if !strings.HasSuffix(base, "/") {
|
if !strings.HasSuffix(base, "/") {
|
||||||
base += "/"
|
base += "/"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue