fix: [sync] if push rules don't have the type_attributes set, don't throw an error

test_debug
iglocska 2024-03-21 09:17:04 +01:00
parent 0b49d329e8
commit ed7555f0e7
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
1 changed files with 5 additions and 1 deletions

View File

@ -1058,7 +1058,11 @@ class Event extends AppModel
// prepare attribute for sync
if (!empty($data['Attribute'])) {
foreach ($data['Attribute'] as $key => $attribute) {
if (!empty(Configure::read('MISP.enable_synchronisation_filtering_on_type')) && in_array($attribute['type'], $pushRules['type_attributes']['NOT'])) {
if (
!empty(Configure::read('MISP.enable_synchronisation_filtering_on_type')) &&
!empty($pushRules['type_attributes']['NOT']) &&
in_array($attribute['type'], $pushRules['type_attributes']['NOT'])
) {
unset($data['Attribute'][$key]);
continue;
}