Merge pull request #71 from singularperturbation/feature/content_length

Enforce DB content length limit
This commit is contained in:
Dominik Picheta 2015-11-06 23:14:49 +00:00
commit 338518082c

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) =