fix: [restSearch] Prettifying stix packages with indents

- As it is in stix export function from Model/Event.php
pull/3766/head
chrisr3d 2018-09-27 12:03:49 +02:00
parent d929099966
commit 72c0aa9987
No known key found for this signature in database
GPG Key ID: 6BBED1B63A6D639F
1 changed files with 6 additions and 0 deletions

View File

@ -25,6 +25,12 @@ class StixExport
}
$file = new File($tmpDir . $randomFileName . '.out');
$stix_event = $file->read();
$stix_event = ' ' . substr($file->read(), 0, -1);
$stix_event = explode("\n", $stix_event);
$stix_event[0] = str_replace("STIX_Package", "Package", $stix_event[0]);
$stix_event[count($stix_event)-1] = str_replace("STIX_Package", "Package", $stix_event[count($stix_event)-1]);
$stix_event = implode("\n", $stix_event);
$stix_event = str_replace("\n", "\n ", $stix_event) . "\n";
$file->close();
$file->delete();
return $stix_event;