mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-11 16:03:25 +01:00
Backport #27958 by @yp05327 Mentioned in: https://github.com/go-gitea/gitea/pull/27931#issuecomment-1798016960 Same to #25131, so use the same method to fix this problem. Co-authored-by: yp05327 <576951401@qq.com>
This commit is contained in:
parent
46ac04ce9d
commit
824d40edc6
1 changed files with 2 additions and 5 deletions
|
@ -711,14 +711,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
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue