summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authormrsdizzie <info@mrsdizzie.com>2019-04-05 11:28:10 -0400
committertechknowlogick <matti@mdranta.net>2019-04-05 11:28:10 -0400
commit0bdd81df9d6f13752b93dbcce19a4f703ad43fc2 (patch)
treef1eaf3356d3725a347fa3cfc6dc1fabd256e96ad /templates
parent9bf20f47c4e7b58c4afb92c32b5bf8683e17fc39 (diff)
downloadgitea-0bdd81df9d6f13752b93dbcce19a4f703ad43fc2.tar.gz
gitea-0bdd81df9d6f13752b93dbcce19a4f703ad43fc2.zip
Properly escape release attachment URL (#6512)
Make sure file attachments on a release get a properly escaped URL when linking. Fixes #6506
Diffstat (limited to 'templates')
-rw-r--r--templates/repo/release/list.tmpl2
1 files changed, 1 insertions, 1 deletions
diff --git a/templates/repo/release/list.tmpl b/templates/repo/release/list.tmpl
index 9df2f6cb81..c57a180873 100644
--- a/templates/repo/release/list.tmpl
+++ b/templates/repo/release/list.tmpl
@@ -77,7 +77,7 @@
{{if .Attachments}}
{{range $attachment := .Attachments}}
<li>
- <a target="_blank" rel="noopener noreferrer" href="{{$.RepoLink}}/releases/download/{{$release.TagName}}/{{$attachment.Name}}">
+ <a target="_blank" rel="noopener noreferrer" href="{{$.RepoLink}}/releases/download/{{$release.TagName | PathEscape}}/{{$attachment.Name | PathEscape}}">
<strong><span class="ui image octicon octicon-package" title='{{$attachment.Name}}'></span> {{$attachment.Name}}</strong>
<span class="ui text grey right">{{$attachment.Size | FileSize}}</span>
</a>