Update Event.php

fix error Undefined offset: 0 in [/var/www/MISP/app/Model/Event.php, line 3682]
pull/9602/head
Karen Yousefi 2024-03-01 22:03:58 +03:30 committed by GitHub
parent 708d18174a
commit 939764d274
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 1 deletions

View File

@ -3679,7 +3679,9 @@ class Event extends AppModel
}
if (!empty($event['Event']['Object'])) {
for ($i=0; $i < count($event['Event']['Object']); $i++) {
$event['Event']['Object'][$i] = $this->updatedLockedFieldForAnalystData($event['Event']['Object'][$i]);
if (isset($event['Event']['Object'][$i])) {
$event['Event']['Object'][$i] = $this->updatedLockedFieldForAnalystData($event['Event']['Object'][$i]);
}
if (!empty($event['Event']['Object'][$i])) {
for ($j=0; $j < count($event['Event']['Object'][$i]['Attribute']); $j++) {
$event['Event']['Object'][$i]['Attribute'][$j] = $this->updatedLockedFieldForAnalystData($event['Event']['Object'][$i]['Attribute'][$j]);