1
0
mirror of https://github.com/golang/go synced 2024-11-18 11:34:45 -07:00

godoc: don't quote search term to avoid escaping regexps

This is safe because the page title is HTML-escaped as it is displayed.

Fixes golang/go#14208

Change-Id: Ib98071a08adeaad79043b9a2eb07bc7a5e8d251d
Reviewed-on: https://go-review.googlesource.com/19242
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Andrew Gerrand 2016-02-05 11:04:38 +11:00
parent 02f1928320
commit fe74a41861

View File

@ -110,7 +110,7 @@ func (p *Presentation) HandleSearch(w http.ResponseWriter, r *http.Request) {
var title string
if haveResults := contents.Len() > 0; haveResults {
title = fmt.Sprintf(`Results for query %q`, query)
title = fmt.Sprintf(`Results for query: %v`, query)
if !p.Corpus.IndexEnabled {
result.Alert = ""
}