fix: [object:edit] Correctly set the SG of the added new attributes

Fix #6025
pull/6143/head
mokaddem 2020-07-24 10:13:54 +02:00
parent 2169fe5717
commit f9b851f229
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
1 changed files with 2 additions and 2 deletions

View File

@ -872,7 +872,7 @@ class MispObject extends AppModel
$newAttribute['value'] = $forcedSeenOnElements['last_seen'];
}
}
if (!isset($newAttribute['timestamp'])) {
if (!isset($newAttribute['distribution'])) {
$newAttribute['distribution'] = Configure::read('MISP.default_attribute_distribution');
if ($newAttribute['distribution'] == 'event') {
$newAttribute['distribution'] = 5;
@ -906,7 +906,7 @@ class MispObject extends AppModel
$newAttribute['last_seen'] = $object['Object']['last_seen'];
$different = true;
}
if (!isset($newAttribute['timestamp'])) {
if (!isset($newAttribute['distribution'])) {
$newAttribute['distribution'] = Configure::read('MISP.default_attribute_distribution');
if ($newAttribute['distribution'] == 'event') {
$newAttribute['distribution'] = 5;