If you try to send the message "0" then the empty($message['body']) on line 1775 evaluates as true and the message isn't validated. Since it is a reasonable use case that somebody would want to send "0" as a message I thought I would report this problem.

It could be fixed by changing line 1775 from:
if (!empty($message['thread_id']) && empty($message['body'])) {
To:
if (!empty($message['thread_id']) && ($message['body'] === NULL || $message['body'] === '') ) {

CommentFileSizeAuthor
#1 allow_sending_0_messages.patch908 bytesberdir

Comments

berdir’s picture

Status: Active » Needs review
StatusFileSize
new908 bytes

Made a patch of your change, just making sure all tests pass with this.

berdir’s picture

Status: Needs review » Fixed

Commited to all branches.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.