Skip to content

Commit ed527b6

Browse files
GiteaBotbytedream
andauthored
Fix only text/* being viewable in web UI (go-gitea#34374) (go-gitea#34378)
Backport go-gitea#34374 by @bytedream Regression from go-gitea#34356, files like SVGs should be editable too (go-gitea#34356 (comment)). Co-authored-by: bytedream <[email protected]>
1 parent e4717d4 commit ed527b6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

routers/web/repo/editor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ func editFile(ctx *context.Context, isNewFile bool) {
165165
ctx.Data["FileSize"] = blob.Size()
166166

167167
// Only some file types are editable online as text.
168-
if !fInfo.isTextFile || fInfo.isLFSFile {
168+
if !fInfo.st.IsRepresentableAsText() || fInfo.isLFSFile {
169169
ctx.NotFound(nil)
170170
return
171171
}

0 commit comments

Comments
 (0)