fix: [stix2 export] Avoiding the "end" function to return a notice

- It looks like depending on the Php version, the
  end function does not like to have the reference
  of an array. By delaying its call, we pass the
  actual array and the notice no longer appears
pull/5776/head
chrisr3d 2020-04-06 15:14:23 +02:00
parent e898c121b1
commit 8f90f79255
No known key found for this signature in database
GPG Key ID: 6BBED1B63A6D639F
1 changed files with 2 additions and 2 deletions

View File

@ -20,7 +20,7 @@ class Stix2Export extends StixExport
$filename = $this->__scripts_dir . 'tmp/' . $filename;
$my_server = ClassRegistry::init('Server');
$result = shell_exec($my_server->getPythonVersion() . ' ' . $scriptFile . ' ' . $filename . $this->__end_of_cmd);
$result = end(preg_split("/\r\n|\n|\r/", trim($result)));
return $result;
$result = preg_split("/\r\n|\n|\r/", trim($result));
return end($result);
}
}