mirror of https://github.com/MISP/MISP
fix: [internal] Append variable just when not null
parent
a60825cbcc
commit
9bc899e3a4
|
@ -281,7 +281,7 @@ class EventShell extends AppShell
|
|||
$userId = $this->args[0];
|
||||
$jobId = $this->args[1];
|
||||
$eventId = $this->args[2];
|
||||
$oldpublish = $this->args[3];
|
||||
$oldpublish = isset($this->args[3]) ? $this->args[3] : null;
|
||||
$user = $this->getUser($userId);
|
||||
$this->Event->sendAlertEmail($eventId, $user, $oldpublish, $jobId);
|
||||
}
|
||||
|
|
|
@ -3166,16 +3166,20 @@ class Event extends AppModel
|
|||
$job = ClassRegistry::init('Job');
|
||||
$jobId = $job->createJob($user, Job::WORKER_EMAIL, 'publish_alert_email', "Event: $id", 'Sending...');
|
||||
|
||||
$args = [
|
||||
'alertemail',
|
||||
$user['id'],
|
||||
$jobId,
|
||||
$id,
|
||||
];
|
||||
if ($oldpublish !== null) {
|
||||
$args[] = $oldpublish;
|
||||
}
|
||||
|
||||
$this->getBackgroundJobsTool()->enqueue(
|
||||
BackgroundJobsTool::EMAIL_QUEUE,
|
||||
BackgroundJobsTool::CMD_EVENT,
|
||||
[
|
||||
'alertemail',
|
||||
$user['id'],
|
||||
$jobId,
|
||||
$id,
|
||||
$oldpublish
|
||||
],
|
||||
$args,
|
||||
true,
|
||||
$jobId
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue