mirror of
https://github.com/osmarks/mycorrhiza.git
synced 2025-03-05 19:18:18 +00:00
Categories: Ignore empty hypha names and cat names in requests
This commit is contained in:
parent
3025aab445
commit
0446fc4794
@ -47,6 +47,10 @@ func handlerRemoveFromCategory(w http.ResponseWriter, rq *http.Request) {
|
||||
_, _ = io.WriteString(w, "403 Forbidden")
|
||||
return
|
||||
}
|
||||
if hyphaName == "" || catName == "" {
|
||||
http.Redirect(w, rq, redirectTo, http.StatusSeeOther)
|
||||
return
|
||||
}
|
||||
categories.RemoveHyphaFromCategory(hyphaName, catName)
|
||||
http.Redirect(w, rq, redirectTo, http.StatusSeeOther)
|
||||
}
|
||||
@ -63,6 +67,10 @@ func handlerAddToCategory(w http.ResponseWriter, rq *http.Request) {
|
||||
_, _ = io.WriteString(w, "403 Forbidden")
|
||||
return
|
||||
}
|
||||
if hyphaName == "" || catName == "" {
|
||||
http.Redirect(w, rq, redirectTo, http.StatusSeeOther)
|
||||
return
|
||||
}
|
||||
categories.AddHyphaToCategory(hyphaName, catName)
|
||||
http.Redirect(w, rq, redirectTo, http.StatusSeeOther)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user