Fix replace url with id

This commit is contained in:
Mikhail Klementyev 2016-07-26 00:04:32 +03:00
parent 69d33189ad
commit 50b0c0a520

View File

@ -38,8 +38,10 @@ func parseLink(db *sql.DB, oldPage, value string, req *http.Request) (htmlPage s
} }
} }
htmlPage = oldPage
for _, s := range []string{value, html.EscapeString(value)} { for _, s := range []string{value, html.EscapeString(value)} {
htmlPage = strings.Replace(oldPage, "\""+s+"\"", htmlPage = strings.Replace(htmlPage, "\""+s+"\"",
"\""+fmt.Sprintf("%d", linkNo)+"\"", -1) "\""+fmt.Sprintf("%d", linkNo)+"\"", -1)
} }