소스 검색

Fix #312. Quote file names of attachments.

Justin 10 년 전
부모
커밋
ad7beb78d0
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      routers/repo/issue.go

+ 3 - 1
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 + "\"")
 }