summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author无闻 <joe2010xtmf@163.com>2014-07-25 01:14:33 -0400
committer无闻 <joe2010xtmf@163.com>2014-07-25 01:14:33 -0400
commit30d7397f9745286282bce2dec960aa9e0e02af94 (patch)
treecb2d24700f6d11c76bba298f3deadedd0523c95f
parent0f3414ec394a5ebdd7137c487e8945d5ad2fad58 (diff)
parentad7beb78d0933e59103bf2862148431902ae2d91 (diff)
downloadgitea-30d7397f9745286282bce2dec960aa9e0e02af94.tar.gz
gitea-30d7397f9745286282bce2dec960aa9e0e02af94.zip
Merge pull request #314 from nuss-justin/issue/312
Fix #312. Quote file names of attachments.
-rw-r--r--routers/repo/issue.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/routers/repo/issue.go b/routers/repo/issue.go
index f3d9280644..a5a2a28eca 100644
--- a/routers/repo/issue.go
+++ b/routers/repo/issue.go
@@ -1079,5 +1079,7 @@ func IssueGetAttachment(ctx *middleware.Context, params martini.Params) {
return
}
- ctx.ServeFile(attachment.Path, attachment.Name)
+ // Fix #312. Attachments with , in their name are not handled correctly by Google Chrome.
+ // We must put the name in " manually.
+ ctx.ServeFile(attachment.Path, "\"" + attachment.Name + "\"")
}