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:
parent
e3638bd2b1
commit
a66a3cd448
@ -54,9 +54,14 @@ public function readFormParameters() {
|
|||||||
*/
|
*/
|
||||||
public function validate() {
|
public function validate() {
|
||||||
parent::validate();
|
parent::validate();
|
||||||
|
|
||||||
if ($this->message === '') {
|
if ($this->message === '') {
|
||||||
throw new UserInputException('text');
|
throw new UserInputException('text');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (strlen($this->message) > CHAT_MAX_LENGTH) {
|
||||||
|
throw new UserInputException('text', 'tooLong');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user