Merge pull request #23109 from Easya-Solutions/new-ticket-message-length-limit

FIX data too long in ticket message
This commit is contained in:
Laurent Destailleur 2022-12-17 02:17:33 +01:00 committed by GitHub
commit b4076612e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)) {