Merge branch 'pr_improves_empty_input_checks' of git://github.com/gradha/nimforum into gradha-pr_improves_empty_input_checks
This commit is contained in:
commit
32cacd2b99
1 changed files with 5 additions and 2 deletions
|
|
@ -321,10 +321,13 @@ proc crud(c: TCrud, table: string, data: varargs[string]): TSqlQuery =
|
|||
|
||||
template retrSubject(c: expr) =
|
||||
let subject {.inject.} = c.req.params["subject"]
|
||||
if subject.len < 3: return setError(c, "subject", "Subject not long enough")
|
||||
|
||||
if subject.strip.len < 3:
|
||||
return setError(c, "subject", "Subject not long enough")
|
||||
|
||||
template retrContent(c: expr) =
|
||||
let content {.inject.} = c.req.params["content"]
|
||||
if content.strip.len < 10:
|
||||
return setError(c, "content", "Content not long enough")
|
||||
if not validateRst(c, content): return false
|
||||
|
||||
template retrPost(c: expr) =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue