fix spaces in searches turning into plusses
This commit is contained in:
parent
559283566b
commit
5f2a1b528d
@ -157,9 +157,9 @@ func (this *ArchiveServer) legacyRoute(w http.ResponseWriter, r *http.Request) {
|
|||||||
|
|
||||||
if u.hasGet("q") {
|
if u.hasGet("q") {
|
||||||
if u.hasGet("rx") {
|
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 {
|
} 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") {
|
} else if u.hasGet("y") && u.hasGet("m") {
|
||||||
|
2
util.go
2
util.go
@ -25,7 +25,7 @@ func (this *URLHelper) intval(sz string) int {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (this *URLHelper) get(sz string) string {
|
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 {
|
func (this *URLHelper) hasGet(sz string) bool {
|
||||||
|
Loading…
Reference in New Issue
Block a user