add check if empty reply
This commit is contained in:
parent
47c37be080
commit
dbc2139511
1 changed files with 2 additions and 0 deletions
|
|
@ -397,6 +397,8 @@ let build_reply ~comment ~image_info ~tag_list ?parent_id user_id =
|
||||||
else if List.length tag_list > 30 then Error "too much tags"
|
else if List.length tag_list > 30 then Error "too much tags"
|
||||||
else if List.exists (fun tag -> String.length tag > 100) tag_list then
|
else if List.exists (fun tag -> String.length tag > 100) tag_list then
|
||||||
Error "tag too long"
|
Error "tag too long"
|
||||||
|
else if Option.is_none image_info && String.length (String.trim comment) = 0
|
||||||
|
then Error "Your post must contain an image or a comment"
|
||||||
else
|
else
|
||||||
let tag_list =
|
let tag_list =
|
||||||
List.map String.lowercase_ascii
|
List.map String.lowercase_ascii
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue