aboutsummaryrefslogtreecommitdiffstats
path: root/templates/repo/editor/upload.tmpl
diff options
context:
space:
mode:
authorGiteabot <teabot@gitea.io>2024-04-16 03:42:15 +0800
committerGitHub <noreply@github.com>2024-04-15 21:42:15 +0200
commitf52b1db305f887c917e6c875b8ac4f8b784b825b (patch)
tree18739be51430e285e0d22e0a5163fcf339e9f342 /templates/repo/editor/upload.tmpl
parent3d31b5963e81b055318b4e6026239cda848bb22c (diff)
downloadgitea-f52b1db305f887c917e6c875b8ac4f8b784b825b.tar.gz
gitea-f52b1db305f887c917e6c875b8ac4f8b784b825b.zip
Convert max file name length to 255 (#30489) (#30504)
Backport #30489 by @yp05327 Quick/Partly fix #29907 In Linux and MacOS, by default the max file name length is 255. In windows, it depends on the version and settings, and has no file name length limitation, but has path length limitation. By default it is 260, considering path length is longer than filename, so I think it is ok to do this. For Windows, see https://learn.microsoft.com/windows/win32/fileio/maximum-file-path-limitation?tabs=registry For Linux, see https://github.com/torvalds/linux/blob/master/include/uapi/linux/limits.h#L12-L13 For MacOS, see https://discussions.apple.com/thread/254788848?sortBy=best Co-authored-by: yp05327 <576951401@qq.com>
Diffstat (limited to 'templates/repo/editor/upload.tmpl')
-rw-r--r--templates/repo/editor/upload.tmpl2
1 files changed, 1 insertions, 1 deletions
diff --git a/templates/repo/editor/upload.tmpl b/templates/repo/editor/upload.tmpl
index 0a7c49dae3..5725020406 100644
--- a/templates/repo/editor/upload.tmpl
+++ b/templates/repo/editor/upload.tmpl
@@ -13,7 +13,7 @@
{{range $i, $v := .TreeNames}}
<div class="breadcrumb-divider">/</div>
{{if eq $i $l}}
- <input type="text" id="file-name" maxlength="500" value="{{$v}}" placeholder="{{ctx.Locale.Tr "repo.editor.add_subdir"}}" autofocus>
+ <input type="text" id="file-name" maxlength="255" value="{{$v}}" placeholder="{{ctx.Locale.Tr "repo.editor.add_subdir"}}" autofocus>
<span data-tooltip-content="{{ctx.Locale.Tr "repo.editor.filename_help"}}">{{svg "octicon-info"}}</span>
{{else}}
<span class="section"><a href="{{$.BranchLink}}/{{index $.TreePaths $i | PathEscapeSegments}}">{{$v}}</a></span>