Fix only text/* being viewable in web UI (#34374)

Regression from #34356, files like SVGs should be editable too
(https://github.com/go-gitea/gitea/pull/34356#discussion_r2072766240).
This commit is contained in:
bytedream
2025-05-05 23:15:22 +02:00
committed by GitHub
parent 712fccadd6
commit 12bf0b8e42

View File

@ -165,7 +165,7 @@ func editFile(ctx *context.Context, isNewFile bool) {
ctx.Data["FileSize"] = blob.Size()
// Only some file types are editable online as text.
if !fInfo.isTextFile || fInfo.isLFSFile {
if !fInfo.st.IsRepresentableAsText() || fInfo.isLFSFile {
ctx.NotFound(nil)
return
}