aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorUnknwon <joe2010xtmf@163.com>2015-02-02 23:04:36 -0500
committerUnknwon <joe2010xtmf@163.com>2015-02-02 23:04:36 -0500
commitbfce0def25bab777d9287136c60e6e30e9f18591 (patch)
tree8ca839a055a42be37901d633c7bf7ca1357fab77 /modules
parent57291d1e2a3190562c169f8c69e3bc65725ee4f4 (diff)
downloadgitea-bfce0def25bab777d9287136c60e6e30e9f18591.tar.gz
gitea-bfce0def25bab777d9287136c60e6e30e9f18591.zip
modules/base: fix README filename checker, fix #877
Diffstat (limited to 'modules')
-rw-r--r--modules/base/markdown.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/modules/base/markdown.go b/modules/base/markdown.go
index c7369ab9fd..d3f3e5feaf 100644
--- a/modules/base/markdown.go
+++ b/modules/base/markdown.go
@@ -63,12 +63,18 @@ func IsImageFile(data []byte) (string, bool) {
return contentType, false
}
+// IsReadmeFile returns true if given file name suppose to be a README file.
func IsReadmeFile(name string) bool {
name = strings.ToLower(name)
if len(name) < 6 {
return false
+ } else if len(name) == 6 {
+ if name == "readme" {
+ return true
+ }
+ return false
}
- if name[:6] == "readme" {
+ if name[:7] == "readme." {
return true
}
return false