From 5a5080496c9d9c49b62c70a1d3f43bce004a2278 Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Sun, 28 Jul 2019 19:00:35 -0400 Subject: [PATCH] add link to remote user profile --- honk.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/honk.go b/honk.go index 6e558f8..94fe1f2 100644 --- a/honk.go +++ b/honk.go @@ -566,7 +566,9 @@ func showhonker(w http.ResponseWriter, r *http.Request) { } else { honks = gethonksbyhonker(u.UserID, name) } - honkpage(w, r, u, nil, honks, "honks by honker: "+name) + name = html.EscapeString(name) + msg := fmt.Sprintf(`honks by honker: %s`, name, name) + honkpage(w, r, u, nil, honks, template.HTML(msg)) } func showcombo(w http.ResponseWriter, r *http.Request) { @@ -574,13 +576,13 @@ func showcombo(w http.ResponseWriter, r *http.Request) { u := login.GetUserInfo(r) honks := gethonksbycombo(u.UserID, name) honks = osmosis(honks, u.UserID) - honkpage(w, r, u, nil, honks, "honks by combo: "+name) + honkpage(w, r, u, nil, honks, template.HTML(html.EscapeString("honks by combo: "+name))) } func showconvoy(w http.ResponseWriter, r *http.Request) { c := r.FormValue("c") u := login.GetUserInfo(r) honks := gethonksbyconvoy(u.UserID, c) - honkpage(w, r, u, nil, honks, "honks in convoy: "+c) + honkpage(w, r, u, nil, honks, template.HTML(html.EscapeString("honks in convoy: "+c))) } func showhonk(w http.ResponseWriter, r *http.Request) { @@ -627,7 +629,7 @@ func showhonk(w http.ResponseWriter, r *http.Request) { } func honkpage(w http.ResponseWriter, r *http.Request, u *login.UserInfo, user *WhatAbout, - honks []*Honk, infomsg string) { + honks []*Honk, infomsg template.HTML) { templinfo := getInfo(r) var userid int64 = -1 if u != nil {