diff --git a/internal/util/posts.go b/internal/util/posts.go index 8951368..5b5f800 100644 --- a/internal/util/posts.go +++ b/internal/util/posts.go @@ -28,7 +28,7 @@ const POST_MEDIA_THUMB_PATH = "web/static/media/posts/thumb" const MAX_THREAD_COUNT = 50 const MAX_BODY_LEN = 3000 -const MAX_SUBJECT_LEN = 100 +const MAX_SUBJECT_LEN = 50 var SUPPORTED_IMAGE_MIME_TYPES = []string{"image/jpeg", "image/png", "image/gif", "image/webp"} var SUPPORTED_VIDEO_MIME_TYPES = []string{"video/webm", "video/mp4", "video/ogg"} diff --git a/web/main.go b/web/main.go index ddd7c9b..3b8dccc 100644 --- a/web/main.go +++ b/web/main.go @@ -165,7 +165,7 @@ func main() { body := strings.TrimSpace(r.FormValue("body")) if len(subject) > util.MAX_SUBJECT_LEN { - http.Error(w, fmt.Sprintf("Subject exceeds %d characters", util.MAX_BODY_LEN), http.StatusBadRequest) + http.Error(w, fmt.Sprintf("Subject exceeds %d characters", util.MAX_SUBJECT_LEN), http.StatusBadRequest) return } diff --git a/web/views/shared/form.templ b/web/views/shared/form.templ index 3a78acd..6ffc0b7 100644 --- a/web/views/shared/form.templ +++ b/web/views/shared/form.templ @@ -3,7 +3,6 @@ package shared import "github.com/dominicf2001/comfychan/internal/database" import "strings" import "github.com/dominicf2001/comfychan/internal/util" -import "strconv" templ NewPostForm(board database.Board, endpoint string, isForThread bool) { @@ -37,11 +36,11 @@ templ NewPostForm(board database.Board, endpoint string, isForThread bool) { class="new-post-form-field" > Subject - + Comment - + File