Merge pull request #71 from singularperturbation/feature/content_length
Enforce DB content length limit
This commit is contained in:
commit
338518082c
1 changed files with 4 additions and 0 deletions
|
|
@ -462,6 +462,10 @@ template retrContent(c: expr) =
|
||||||
let content {.inject.} = c.req.params["content"]
|
let content {.inject.} = c.req.params["content"]
|
||||||
if content.strip.len < 10:
|
if content.strip.len < 10:
|
||||||
return setError(c, "content", "Content not long enough")
|
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
|
if not validateRst(c, content): return false
|
||||||
|
|
||||||
template retrPost(c: expr) =
|
template retrPost(c: expr) =
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue