Skip to content

Commit

Permalink
fix citation error go-gitea#27958
Browse files Browse the repository at this point in the history
  • Loading branch information
yp05327 committed Nov 8, 2023
1 parent 9281a58 commit 99a45f9
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions routers/web/repo/view.go
Original file line number Diff line number Diff line change
Expand Up @@ -716,14 +716,11 @@ func checkCitationFile(ctx *context.Context, entry *git.TreeEntry) {
return
}
defer dataRc.Close()
buf := make([]byte, 1024)
n, err := util.ReadAtMost(dataRc, buf)
ctx.PageData["citationFileContent"], err = blob.GetBlobContent(setting.UI.MaxDisplayFileSize)
if err != nil {
ctx.ServerError("ReadAtMost", err)
ctx.ServerError("GetBlobContent", err)
return
}
buf = buf[:n]
ctx.PageData["citationFileContent"] = string(buf)
break
}
}
Expand Down

0 comments on commit 99a45f9

Please sign in to comment.