1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

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

* 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-05 16:56:30 +02:00
committed by GitHub
parent b16c84de7b
commit 283e87d814
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)