MDL-44342 air notifier: Fixied checking for empty values in event object
This commit is contained in:
@@ -68,7 +68,8 @@ class message_output_airnotifier extends message_output {
|
||||
"type" => $eventdata->component . '_' . $eventdata->name,
|
||||
"device" => "xxxxxxxxxx", // Since at this point we don't know the device, we use a 10 chars device platform.
|
||||
"notif" => "x", // 1 or 0 wheter is a notification or not (it may be a private message).
|
||||
"userfrom" => fullname($eventdata->userfrom));
|
||||
"userfrom" => (!empty($eventdata->userfrom)) ? fullname($eventdata->userfrom) : ''
|
||||
);
|
||||
|
||||
// Calculate the size of the message knowing Apple payload must be lower than 256 bytes.
|
||||
// Airnotifier using few bytes of the payload, we must limit our message to even less characters.
|
||||
@@ -109,10 +110,10 @@ class message_output_airnotifier extends message_output {
|
||||
$curl->setHeader($header);
|
||||
$params = array(
|
||||
'alert' => $message,
|
||||
'date' => $eventdata->timecreated,
|
||||
'date' => (!empty($eventdata->timecreated)) ? $eventdata->timecreated : time(),
|
||||
'site' => $siteid,
|
||||
'type' => $eventdata->component . '_' . $eventdata->name,
|
||||
'userfrom' => fullname($eventdata->userfrom),
|
||||
'userfrom' => (!empty($eventdata->userfrom)) ? fullname($eventdata->userfrom) : '',
|
||||
'device' => $devicetoken->platform,
|
||||
'notif' => (!empty($eventdata->notification)) ? '1' : '0',
|
||||
'token' => $devicetoken->pushid);
|
||||
|
||||
Reference in New Issue
Block a user