[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
This commit is contained in:
Kim Carlbäcker 2016-07-12 00:21:26 +02:00 committed by 无闻
parent de10387f41
commit f4ab50501e
6 changed files with 730 additions and 934 deletions

File diff suppressed because one or more lines are too long

View file

@ -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)