add check if empty reply
This commit is contained in:
parent
21758dfae2
commit
7ad84cc1ab
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.exists (fun tag -> String.length tag > 100) tag_list then
|
||||
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
|
||||
let tag_list =
|
||||
List.map String.lowercase_ascii
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue