fix spaces in searches turning into plusses

This commit is contained in:
mappu 2017-12-10 13:37:22 +13:00
parent 559283566b
commit 5f2a1b528d
2 changed files with 3 additions and 3 deletions

View File

@ -157,9 +157,9 @@ func (this *ArchiveServer) legacyRoute(w http.ResponseWriter, r *http.Request) {
if u.hasGet("q") {
if u.hasGet("rx") {
u.redirectf(`/%d/rx/%s`, hubid, url.QueryEscape(u.get("q")))
u.redirectf(`/%d/rx/%s`, hubid, url.PathEscape(u.get("q")))
} else {
u.redirectf(`/%d/search/%s`, hubid, url.QueryEscape(u.get("q")))
u.redirectf(`/%d/search/%s`, hubid, url.PathEscape(u.get("q")))
}
} else if u.hasGet("y") && u.hasGet("m") {

View File

@ -25,7 +25,7 @@ func (this *URLHelper) intval(sz string) int {
}
func (this *URLHelper) get(sz string) string {
return this.r.URL.Query().Get(sz)
return this.r.URL.Query().Get(sz) // n.b. automatically unescaped
}
func (this *URLHelper) hasGet(sz string) bool {