1
0
mirror of https://github.com/wbbaddons/Tims-Chat.git synced 2024-12-22 21:40:08 +00:00

Disallow to long messages in PHP

This commit is contained in:
Tim Düsterhus 2012-03-04 15:48:10 +01:00
parent e3638bd2b1
commit a66a3cd448

View File

@ -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');
}
}
/**