loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Improve QueryEscape helper function (#29768)

Make it return "template.URL" to follow Golang template's context
auto-escaping.

(cherry picked from commit 3e94ac5c7c6751919453fdb66ba3472e2793759e)

authored by

wxiaoguang and committed by
Earl Warren
5bb08e2b 3bd42e58

+5 -1
+5 -1
modules/templates/helper.go
··· 38 38 "SafeHTML": SafeHTML, 39 39 "HTMLFormat": HTMLFormat, 40 40 "HTMLEscape": HTMLEscape, 41 - "QueryEscape": url.QueryEscape, 41 + "QueryEscape": QueryEscape, 42 42 "JSEscape": JSEscapeSafe, 43 43 "SanitizeHTML": SanitizeHTML, 44 44 "URLJoin": util.URLJoin, ··· 227 227 228 228 func JSEscapeSafe(s string) template.HTML { 229 229 return template.HTML(template.JSEscapeString(s)) 230 + } 231 + 232 + func QueryEscape(s string) template.URL { 233 + return template.URL(url.QueryEscape(s)) 230 234 } 231 235 232 236 // DotEscape wraps a dots in names with ZWJ [U+200D] in order to prevent autolinkers from detecting these as urls