Escape and unescape title
This commit is contained in:
parent
e3ac34ada2
commit
f68ba3ef8e
6
main.go
6
main.go
|
@ -114,7 +114,7 @@ func save(raw string, lang string, title string) []string {
|
||||||
_, err = stmt.Exec(id, id, sha, paste, delKey)
|
_, err = stmt.Exec(id, id, sha, paste, delKey)
|
||||||
check(err)
|
check(err)
|
||||||
} else {
|
} else {
|
||||||
_, err = stmt.Exec(id, title, sha, paste, delKey)
|
_, err = stmt.Exec(id, html.EscapeString(title), sha, paste, delKey)
|
||||||
check(err)
|
check(err)
|
||||||
}
|
}
|
||||||
db.Close()
|
db.Close()
|
||||||
|
@ -225,11 +225,11 @@ func getPaste(paste string, lang string) (string, string) {
|
||||||
return "Error invalid paste", ""
|
return "Error invalid paste", ""
|
||||||
} else {
|
} else {
|
||||||
if lang == "" {
|
if lang == "" {
|
||||||
return html.UnescapeString(s), title
|
return html.UnescapeString(s), html.UnescapeString(title)
|
||||||
} else {
|
} else {
|
||||||
high, err := highlight(s, lang)
|
high, err := highlight(s, lang)
|
||||||
check(err)
|
check(err)
|
||||||
return high, title
|
return high, html.UnescapeString(title)
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue