aboutsummaryrefslogtreecommitdiffstats
path: root/routers/web
diff options
context:
space:
mode:
authorbytedream <bytedream@protonmail.com>2025-05-05 23:15:22 +0200
committerGitHub <noreply@github.com>2025-05-06 00:15:22 +0300
commit12bf0b8e4270956cee1739520d303d9b7527a7f0 (patch)
tree330f7fde04af28f16722517a0458e3a6e4e42e5d /routers/web
parent712fccadd6dcff98bd9ca7515288d5c7645bf802 (diff)
downloadgitea-main.tar.gz
gitea-main.zip
Fix only text/* being viewable in web UI (#34374)HEADmain
Regression from #34356, files like SVGs should be editable too (https://github.com/go-gitea/gitea/pull/34356#discussion_r2072766240).
Diffstat (limited to 'routers/web')
-rw-r--r--routers/web/repo/editor.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/web/repo/editor.go b/routers/web/repo/editor.go
index 514eb0ebfe..03e5b830a0 100644
--- a/routers/web/repo/editor.go
+++ b/routers/web/repo/editor.go
@@ -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
}