diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 2aacffefcd1..2a3160b3b67 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -381,6 +381,11 @@ class Ticket extends CommonObject if (isset($this->message)) { $this->message = trim($this->message); + if (dol_strlen($this->message) > 65000) { + $this->errors[] = 'ErrorFieldTooLong'; + dol_syslog(get_class($this).'::create error -1 message too long', LOG_ERR); + $result = -1; + } } if (isset($this->fk_statut)) { @@ -915,6 +920,11 @@ class Ticket extends CommonObject if (isset($this->message)) { $this->message = trim($this->message); + if (dol_strlen($this->message) > 65000) { + $this->errors[] = 'ErrorFieldTooLong'; + dol_syslog(get_class($this).'::update error -1 message too long', LOG_ERR); + return -1; + } } if (isset($this->fk_statut)) {