sklad: trim spaces from user-supplied attributes
This commit is contained in:
parent
5b7113905e
commit
82c6c34ea5
@ -11,6 +11,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"janouch.name/sklad/imgutil"
|
"janouch.name/sklad/imgutil"
|
||||||
@ -73,9 +74,9 @@ func handleLogout(w http.ResponseWriter, r *http.Request) {
|
|||||||
|
|
||||||
func handleContainerPost(r *http.Request) error {
|
func handleContainerPost(r *http.Request) error {
|
||||||
id := ContainerId(r.FormValue("id"))
|
id := ContainerId(r.FormValue("id"))
|
||||||
description := r.FormValue("description")
|
description := strings.TrimSpace(r.FormValue("description"))
|
||||||
series := r.FormValue("series")
|
series := r.FormValue("series")
|
||||||
parent := ContainerId(r.FormValue("parent"))
|
parent := ContainerId(strings.TrimSpace(r.FormValue("parent")))
|
||||||
_, remove := r.Form["remove"]
|
_, remove := r.Form["remove"]
|
||||||
|
|
||||||
if container, ok := indexContainer[id]; ok {
|
if container, ok := indexContainer[id]; ok {
|
||||||
@ -150,8 +151,8 @@ func handleContainer(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func handleSeriesPost(r *http.Request) error {
|
func handleSeriesPost(r *http.Request) error {
|
||||||
prefix := r.FormValue("prefix")
|
prefix := strings.TrimSpace(r.FormValue("prefix"))
|
||||||
description := r.FormValue("description")
|
description := strings.TrimSpace(r.FormValue("description"))
|
||||||
_, remove := r.Form["remove"]
|
_, remove := r.Form["remove"]
|
||||||
|
|
||||||
if series, ok := indexSeries[prefix]; ok {
|
if series, ok := indexSeries[prefix]; ok {
|
||||||
|
Loading…
Reference in New Issue
Block a user