mirror of https://github.com/MISP/MISP
fix: allow import of json event without the key
parent
cbaef0c37a
commit
6c82021261
|
@ -3573,6 +3573,9 @@ class Event extends AppModel
|
|||
if (isset($dataArray['Event'])) {
|
||||
$dataArray['response']['Event'] = $dataArray['Event'];
|
||||
unset($dataArray['Event']);
|
||||
} else {
|
||||
// Accept an event not containing the `Event` key
|
||||
$dataArray['response']['Event'] = $dataArray;
|
||||
}
|
||||
if (!isset($dataArray['response']) || !isset($dataArray['response']['Event'])) {
|
||||
$exception = $isXml ? __('This is not a valid MISP XML file.') : __('This is not a valid MISP JSON file.');
|
||||
|
|
Loading…
Reference in New Issue