From 6411c9756acff5a303b7d1920824bc38b2cd60d9 Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Sat, 31 Oct 2020 16:29:40 +0300 Subject: [PATCH] Proper URL path escaping --- cmd/sgblog/http.go | 4 ++-- common.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/sgblog/http.go b/cmd/sgblog/http.go index 4712a50..808c3d9 100644 --- a/cmd/sgblog/http.go +++ b/cmd/sgblog/http.go @@ -142,7 +142,7 @@ Topics: {{range .Topics}}[{{.}} {{end}}
{{end}} -{{if .Cfg.CommentsEmail}}[leave comment]{{end}} +{{if .Cfg.CommentsEmail}}[leave comment]{{end}}
{{range $idx, $comment := .Comments}}
comment {{$idx}}:
@@ -798,7 +798,7 @@ func serveHTTP() { Version: sgblog.Version, Cfg: cfg, Title: title, - TitleEscaped: strings.ReplaceAll(title, " ", "%20"), + TitleEscaped: url.PathEscape(fmt.Sprintf("Re: %s (%s)", title, commit.Hash)), When: when, AtomCommentsURL: atomCommentsURL, Parent: parent, diff --git a/common.go b/common.go index 821d5b3..b324d87 100644 --- a/common.go +++ b/common.go @@ -2,6 +2,6 @@ package sgblog const ( - Version = "0.10.0" + Version = "0.10.1" WhenFmt = "2006-01-02 15:04:05Z07:00" ) -- 2.48.1