summaryrefslogtreecommitdiffstats
path: root/models/wiki.go
diff options
context:
space:
mode:
authorJofkos <jofkosde@gmail.com>2015-12-20 18:02:54 +0100
committerJofkos <jofkosde@gmail.com>2015-12-20 18:02:54 +0100
commit072109594425a7f7195111e2a3bc7987429505e0 (patch)
tree0153adb2fff4164b3fe80eb7d535c4004bf777b0 /models/wiki.go
parentc62a6b7a1238524225ec9c214dc5eac7da017663 (diff)
downloadgitea-072109594425a7f7195111e2a3bc7987429505e0.tar.gz
gitea-072109594425a7f7195111e2a3bc7987429505e0.zip
Wiki pages containing question marks in their name weren't loading
(untested)
Diffstat (limited to 'models/wiki.go')
-rw-r--r--models/wiki.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/models/wiki.go b/models/wiki.go
index 86b6c19efc..9c6292cbaa 100644
--- a/models/wiki.go
+++ b/models/wiki.go
@@ -13,6 +13,8 @@ import (
"strings"
"sync"
+ "net/url"
+
"github.com/Unknwon/com"
"github.com/gogits/git-module"
@@ -65,12 +67,12 @@ var wikiWorkingPool = &workingPool{
// ToWikiPageURL formats a string to corresponding wiki URL name.
func ToWikiPageURL(name string) string {
- return strings.Replace(name, " ", "-", -1)
+ return url.QueryEscape(strings.Replace(name, " ", "-", -1))
}
// ToWikiPageName formats a URL back to corresponding wiki page name.
func ToWikiPageName(name string) string {
- return strings.Replace(name, "-", " ", -1)
+ return url.QueryUnescape(strings.Replace(name, "-", " ", -1))
}
// WikiCloneLink returns clone URLs of repository wiki.