diff --git a/app/Model/Attribute.php b/app/Model/Attribute.php index 738cef077..b6da831fd 100644 --- a/app/Model/Attribute.php +++ b/app/Model/Attribute.php @@ -80,6 +80,25 @@ class Attribute extends AppModel 'ip-dst|port' ); + public $captureFields = array( + 'event_id', + 'category', + 'type', + 'value', + 'value1', + 'value2', + 'to_ids', + 'uuid', + 'timestamp', + 'distribution', + 'comment', + 'sharing_group_id', + 'deleted', + 'disable_correlation', + 'object_id', + 'object_relation' + ); + public $searchResponseTypes = array( 'xml' => array( 'type' => 'xml', @@ -3275,24 +3294,7 @@ class Attribute extends AppModel if (isset($attribute['encrypt'])) { $result = $this->handleMaliciousBase64($eventId, $attribute['value'], $attribute['data'], array('md5')); } - $fieldList = array( - 'event_id', - 'category', - 'type', - 'value', - 'value1', - 'value2', - 'to_ids', - 'uuid', - 'timestamp', - 'distribution', - 'comment', - 'sharing_group_id', - 'deleted', - 'disable_correlation', - 'object_id', - 'object_relation' - ); + $fieldList = $this->captureFields; $this->create(); if (!isset($attribute['distribution'])) { $attribute['distribution'] = Configure::read('MISP.default_attribute_distribution'); diff --git a/app/Model/Event.php b/app/Model/Event.php index 1cbc7f6bb..2ea48587d 100755 --- a/app/Model/Event.php +++ b/app/Model/Event.php @@ -2690,22 +2690,7 @@ class Event extends AppModel 'disable_correlation', 'extends_uuid' ), - 'Attribute' => array( - 'event_id', - 'category', - 'type', - 'value', - 'to_ids', - 'uuid', - 'timestamp', - 'distribution', - 'comment', - 'sharing_group_id', - 'deleted', - 'disable_correlation', - 'object_id', - 'object_relation' - ), + 'Attribute' => $this->Attribute->captureFields, 'Object' => array( 'name', 'meta-category',