mirror of https://github.com/MISP/MISP
fix: Truncate the change field in log entries if it becomes humongous
- solves a rare situation with massive PGP keys breaking user additions / editspull/2229/head
parent
165266b072
commit
3cccbb9c5c
|
@ -87,10 +87,11 @@ class Log extends AppModel {
|
|||
}
|
||||
if (!isset($this->data['Log']['created'])) $this->data['Log']['created'] = date('Y-m-d H:i:s');
|
||||
if (!isset($this->data['Log']['org'])) $this->data['Log']['org'] = 'SYSTEM';
|
||||
if (isset($this->data['Log']['title'])) {
|
||||
if (strlen($this->data['Log']['title']) >= 65535) {
|
||||
$this->data['Log']['title'] = substr($this->data['Log']['title'], 0, 65532) . '...';
|
||||
}
|
||||
if (isset($this->data['Log']['title']) && strlen($this->data['Log']['title']) >= 65535) {
|
||||
$this->data['Log']['title'] = substr($this->data['Log']['title'], 0, 65532) . '...';
|
||||
}
|
||||
if (isset($this->data['Log']['change']) && strlen($this->data['Log']['change']) >= 65535) {
|
||||
$this->data['Log']['change'] = substr($this->data['Log']['change'], 0, 65532) . '...';
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
Loading…
Reference in New Issue