mirror of https://github.com/MISP/MISP
fix: [API] set attribute distribution if it isn't set in the capture attribute call
- should have worked via the beforevalidate() but it didn't - ah wellpull/3510/head
parent
b99adf5d76
commit
1930823474
|
@ -3342,6 +3342,12 @@ class Attribute extends AppModel
|
||||||
'object_relation'
|
'object_relation'
|
||||||
);
|
);
|
||||||
$this->create();
|
$this->create();
|
||||||
|
if (!isset($attribute['distribution'])) {
|
||||||
|
$attribute['distribution'] = Configure::read('MISP.default_attribute_distribution');
|
||||||
|
if ($attribute['distribution'] == 'event') {
|
||||||
|
$attribute['distribution'] = 5;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (!$this->save($attribute, array('fieldList' => $fieldList))) {
|
if (!$this->save($attribute, array('fieldList' => $fieldList))) {
|
||||||
$attribute_short = (isset($attribute['category']) ? $attribute['category'] : 'N/A') . '/' . (isset($attribute['type']) ? $attribute['type'] : 'N/A') . ' ' . (isset($attribute['value']) ? $attribute['value'] : 'N/A');
|
$attribute_short = (isset($attribute['category']) ? $attribute['category'] : 'N/A') . '/' . (isset($attribute['type']) ? $attribute['type'] : 'N/A') . ' ' . (isset($attribute['value']) ? $attribute['value'] : 'N/A');
|
||||||
$log->create();
|
$log->create();
|
||||||
|
|
Loading…
Reference in New Issue