~ols/mudliag

63b09db60606577039840134c47575a2887f83f0 — Oliver Leaver-Smith 3 years ago dc3e544
require title, submitter, and tags
1 files changed, 7 insertions(+), 0 deletions(-)

M main.go
M main.go => main.go +7 -0
@@ 320,8 320,15 @@ var actuallySubmit = http.HandlerFunc(func(w http.ResponseWriter, r *http.Reques
		authorBool = false
	}
	tags := html.EscapeString(reg.ReplaceAllString(r.FormValue("tags"), ""))
	if len(title) < 1 || len(submitter) < 1 || len(tags) < 1 {
		w.Write([]byte("You missed a field"))
		return
	}
	slug := StringWithCharset(6, charset)
	currentTime := time.Now()
	if len(url) < 1 {
		url = "/s/" + slug
	}

	submissionTags := strings.Split(tags, ",")