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:
parent
35e01a6fcb
commit
bf96ec645e
1 changed files with 4 additions and 0 deletions
|
|
@ -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) =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue