diff options
author | Kim Carlbäcker <kim.carlbacker@gmail.com> | 2016-07-12 00:21:26 +0200 |
---|---|---|
committer | 无闻 <u@gogs.io> | 2016-07-12 06:21:26 +0800 |
commit | f4ab50501ebc3d216dd216c72f5f8ff53fa6efc1 (patch) | |
tree | 787acd1bf0d3a69c348c509a299e27995b094190 /modules/setting | |
parent | de10387f41c02aef2d97ca5f247a422f18e6fb38 (diff) | |
download | gitea-f4ab50501ebc3d216dd216c72f5f8ff53fa6efc1.tar.gz gitea-f4ab50501ebc3d216dd216c72f5f8ff53fa6efc1.zip |
[Fix] Don't display way too large files #1513 (#3253)
* Add MaxDisplayFileSize setting
* Don't show files that are too large
* Localized FileTooLarge
* Change IsFileTooBig => IsFileTooLarge
Diffstat (limited to 'modules/setting')
-rw-r--r-- | modules/setting/setting.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/modules/setting/setting.go b/modules/setting/setting.go index 10cb2b2a21..5c396a7d60 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -123,6 +123,7 @@ var ( AdminNoticePagingNum int AdminOrgPagingNum int ThemeColorMetaTag string + MaxDisplayFileSize int64 // Markdown sttings Markdown struct { @@ -441,6 +442,7 @@ func NewContext() { ExplorePagingNum = sec.Key("EXPLORE_PAGING_NUM").MustInt(20) IssuePagingNum = sec.Key("ISSUE_PAGING_NUM").MustInt(10) FeedMaxCommitNum = sec.Key("FEED_MAX_COMMIT_NUM").MustInt(5) + MaxDisplayFileSize = sec.Key("MAX_DISPLAY_FILE_SIZE").MustInt64(8388608) sec = Cfg.Section("ui.admin") AdminUserPagingNum = sec.Key("USER_PAGING_NUM").MustInt(50) |