mirror of https://github.com/MISP/MISP
fix: [object restsearch] fixed, no more trailing commas
parent
cd7d01306d
commit
0ed0324417
|
@ -1437,12 +1437,16 @@ class MispObject extends AppModel
|
|||
{
|
||||
$continue = true;
|
||||
while ($continue) {
|
||||
$temp = '';
|
||||
$this->Whitelist = ClassRegistry::init('Whitelist');
|
||||
$results = $this->fetchObjects($user, $params, $continue);
|
||||
if (empty($results)) {
|
||||
$loop = false;
|
||||
return true;
|
||||
}
|
||||
if ($elementCounter !== 0 && !empty($results)) {
|
||||
$temp .= $exportTool->separator($exportToolParams);
|
||||
}
|
||||
if ($params['includeSightingdb']) {
|
||||
$this->Sightingdb = ClassRegistry::init('Sightingdb');
|
||||
$results = $this->Sightingdb->attachToObjects($results, $user);
|
||||
|
@ -1451,7 +1455,6 @@ class MispObject extends AppModel
|
|||
$results = $this->Whitelist->removeWhitelistedFromArray($results, true);
|
||||
$results = array_values($results);
|
||||
$i = 0;
|
||||
$temp = '';
|
||||
foreach ($results as $object) {
|
||||
$elementCounter++;
|
||||
$handlerResult = $exportTool->handler($object, $exportToolParams);
|
||||
|
@ -1466,9 +1469,6 @@ class MispObject extends AppModel
|
|||
if (!$loop) {
|
||||
$continue = false;
|
||||
}
|
||||
if ($continue) {
|
||||
$temp .= $exportTool->separator($exportToolParams);
|
||||
}
|
||||
fwrite($tmpfile, $temp);
|
||||
}
|
||||
return true;
|
||||
|
|
Loading…
Reference in New Issue