Enforce DB content length limit

Content length limit of 1000 characters at DB level should be enforced
at the application level.
This commit is contained in:
Sloane Simmons 2015-10-31 20:03:44 -05:00
commit bf96ec645e

View file

@ -462,6 +462,10 @@ template retrContent(c: expr) =
let content {.inject.} = c.req.params["content"]
if content.strip.len < 10:
return setError(c, "content", "Content not long enough")
# Enforce DB content length for posts
elif content.len > 1000:
return setError(c, "content", "Post length too long")
if not validateRst(c, content): return false
template retrPost(c: expr) =