FIX data too long for ticket message on update

This commit is contained in:
VESSILLER 2022-12-15 15:08:14 +01:00
parent a5933e24d3
commit 73202215c0

View File

@ -920,7 +920,11 @@ class Ticket extends CommonObject
if (isset($this->message)) {
$this->message = trim($this->message);
if (dol_strlen($this->message) > 65000) $this->message = dol_substr($this->message, 0, 65000, 'UTF-8') . '...';
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)) {