1
1
mirror of https://github.com/go-gitea/gitea synced 2025-08-12 04:28:21 +00:00

Fix rendering of wiki page list if wiki repo contains other files (#3454) (#3463)

* Fix rendering of wiki page list if wiki repo contains other files

* Improve wiki filename tests
This commit is contained in:
Lauris BH
2018-02-06 07:59:44 +02:00
committed by GitHub
parent b27e10d6e4
commit f61ef28f26
4 changed files with 26 additions and 2 deletions

View File

@@ -45,7 +45,7 @@ func WikiNameToFilename(name string) string {
// WikiFilenameToName converts a wiki filename to its corresponding page name.
func WikiFilenameToName(filename string) (string, error) {
if !strings.HasSuffix(filename, ".md") {
return "", fmt.Errorf("Invalid wiki filename: %s", filename)
return "", ErrWikiInvalidFileName{filename}
}
basename := filename[:len(filename)-3]
unescaped, err := url.QueryUnescape(basename)