diff --git a/file/lib/form/ChatForm.class.php b/file/lib/form/ChatForm.class.php index 9e7b129..4a8ec7e 100644 --- a/file/lib/form/ChatForm.class.php +++ b/file/lib/form/ChatForm.class.php @@ -54,9 +54,14 @@ public function readFormParameters() { */ public function validate() { parent::validate(); + if ($this->message === '') { throw new UserInputException('text'); } + + if (strlen($this->message) > CHAT_MAX_LENGTH) { + throw new UserInputException('text', 'tooLong'); + } } /**