return
}
- if comment.Type == models.CommentTypeComment {
- if err := comment.LoadAttachments(); err != nil {
- ctx.ServerError("LoadAttachments", err)
- return
- }
- }
-
if !ctx.IsSigned || (ctx.User.ID != comment.PosterID && !ctx.Repo.CanWriteIssuesOrPulls(comment.Issue.IsPull)) {
ctx.Error(http.StatusForbidden)
return
return
}
+ if ctx.FormBool("ignore_attachments") {
+ return
+ }
+
+ if comment.Type == models.CommentTypeComment {
+ if err := comment.LoadAttachments(); err != nil {
+ ctx.ServerError("LoadAttachments", err)
+ return
+ }
+ }
+
if err := updateAttachments(comment, ctx.FormStrings("files[]")); err != nil {
ctx.ServerError("UpdateAttachments", err)
return
const {updateUrl, context} = editContentZone.dataset;
await $.post(updateUrl, {
+ ignore_attachments: true,
_csrf: window.config.csrf,
content: newContent,
- context,
+ context
});
rawContent.textContent = newContent;