Ensure we only have the last line from the shell command

pull/5612/head
Jason Kendall 2020-02-07 13:43:11 -05:00
parent 08fc1c77ed
commit e3b1e8c74a
1 changed files with 1 additions and 0 deletions

View File

@ -5694,6 +5694,7 @@ class Event extends AppModel
}
$shell_command .= ' ' . escapeshellarg(Configure::read('MISP.default_event_distribution')) . ' ' . escapeshellarg(Configure::read('MISP.default_attribute_distribution')) . ' 2>' . APP . 'tmp/logs/exec-errors.log';
$result = shell_exec($shell_command);
$result = end(preg_split("/\r\n|\n|\r/", trim($result)));
$tempFile = file_get_contents($tempFilePath);
unlink($tempFilePath);
if (trim($result) == '1') {