summaryrefslogtreecommitdiffstats
path: root/modules/base
diff options
context:
space:
mode:
authorUnknwon <joe2010xtmf@163.com>2014-10-19 01:35:24 -0400
committerUnknwon <joe2010xtmf@163.com>2014-10-19 01:35:24 -0400
commita342d58d7e208ef64d29151970244de7f7b4fac6 (patch)
tree55972233ac1517513d865dc2ba4895b7cdaf95cb /modules/base
parentd7d167ac63e0ada717f78383016f5b208a1b209a (diff)
downloadgitea-a342d58d7e208ef64d29151970244de7f7b4fac6.tar.gz
gitea-a342d58d7e208ef64d29151970244de7f7b4fac6.zip
Able to fork repo to individuals
Diffstat (limited to 'modules/base')
-rw-r--r--modules/base/template.go14
1 files changed, 12 insertions, 2 deletions
diff --git a/modules/base/template.go b/modules/base/template.go
index 6d25cd45a8..58572e24e4 100644
--- a/modules/base/template.go
+++ b/modules/base/template.go
@@ -110,7 +110,7 @@ var TemplateFuncs template.FuncMap = map[string]interface{}{
"List": List,
"Mail2Domain": func(mail string) string {
if !strings.Contains(mail, "@") {
- return "try.gogits.org"
+ return "try.gogs.io"
}
suffix := strings.SplitN(mail, "@", 2)[1]
@@ -121,7 +121,17 @@ var TemplateFuncs template.FuncMap = map[string]interface{}{
return domain
},
"SubStr": func(str string, start, length int) string {
- return str[start : start+length]
+ if len(str) == 0 {
+ return ""
+ }
+ end := start + length
+ if length == -1 {
+ end = len(str)
+ }
+ if len(str) < end {
+ return str
+ }
+ return str[start:end]
},
"DiffTypeToStr": DiffTypeToStr,
"DiffLineTypeToStr": DiffLineTypeToStr,