summaryrefslogtreecommitdiffstats
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
parent57291d1e2a3190562c169f8c69e3bc65725ee4f4 (diff)
downloadgitea-bfce0def25bab777d9287136c60e6e30e9f18591.tar.gz
gitea-bfce0def25bab777d9287136c60e6e30e9f18591.zip
modules/base: fix README filename checker, fix #877
-rw-r--r--gogs.go2
-rw-r--r--modules/base/markdown.go8
-rw-r--r--templates/.VERSION2
3 files changed, 9 insertions, 3 deletions
diff --git a/gogs.go b/gogs.go
index 423d301907..1f0f15b8bf 100644
--- a/gogs.go
+++ b/gogs.go
@@ -17,7 +17,7 @@ import (
"github.com/gogits/gogs/modules/setting"
)
-const APP_VER = "0.5.12.0201 Beta"
+const APP_VER = "0.5.12.0202 Beta"
func init() {
runtime.GOMAXPROCS(runtime.NumCPU())
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
diff --git a/templates/.VERSION b/templates/.VERSION
index 6e3c63ed85..aa8ee543a2 100644
--- a/templates/.VERSION
+++ b/templates/.VERSION
@@ -1 +1 @@
-0.5.12.0201 Beta \ No newline at end of file
+0.5.12.0202 Beta \ No newline at end of file