1
0
mirror of https://github.com/osmarks/mycorrhiza.git synced 2025-11-04 17:43:01 +00:00

Categories: Sanitize names before processing

This commit is contained in:
Timur Ismagilov
2022-03-20 14:50:18 +03:00
parent cdeb378327
commit cc4f3c9aed
2 changed files with 6 additions and 6 deletions

View File

@@ -25,8 +25,8 @@ func handlerCategory(w http.ResponseWriter, rq *http.Request) {
func handlerRemoveFromCategory(w http.ResponseWriter, rq *http.Request) {
util.PrepareRq(rq)
var (
hyphaName = rq.PostFormValue("hypha")
catName = rq.PostFormValue("cat")
hyphaName = util.CanonicalName(rq.PostFormValue("hypha"))
catName = util.CanonicalName(rq.PostFormValue("cat"))
redirectTo = rq.PostFormValue("redirect-to")
)
categories.RemoveHyphaFromCategory(hyphaName, catName)
@@ -36,8 +36,8 @@ func handlerRemoveFromCategory(w http.ResponseWriter, rq *http.Request) {
func handlerAddToCategory(w http.ResponseWriter, rq *http.Request) {
util.PrepareRq(rq)
var (
hyphaName = rq.PostFormValue("hypha")
catName = rq.PostFormValue("cat")
hyphaName = util.CanonicalName(rq.PostFormValue("hypha"))
catName = util.CanonicalName(rq.PostFormValue("cat"))
redirectTo = rq.PostFormValue("redirect-to")
)
categories.AddHyphaToCategory(hyphaName, catName)