fix PHP Warning: explode() expects parameter 2 to be string, array given

This commit is contained in:
Ralf Becker 2018-01-31 09:26:08 +01:00
parent b53ee7ba87
commit 8f5734252c

View File

@ -230,6 +230,7 @@ class infolog_tracking extends Api\Storage\Tracking
{ {
//error_log(__METHOD__.__LINE__.' Key:'.$name.' val:'.array2string($value)); //error_log(__METHOD__.__LINE__.' Key:'.$name.' val:'.array2string($value));
if ($name=='info_from' && empty($value)) if ($name=='info_from' && empty($value))
{
if(!empty($data['info_contact']) && is_array($data['link_to']['to_id'])) if(!empty($data['info_contact']) && is_array($data['link_to']['to_id']))
{ {
$lkeys = array_keys($data['link_to']['to_id']); $lkeys = array_keys($data['link_to']['to_id']);
@ -242,8 +243,8 @@ class infolog_tracking extends Api\Storage\Tracking
else if ($data['info_link_id']) else if ($data['info_link_id'])
{ {
$this->infolog->link_id2from($data); $this->infolog->link_id2from($data);
list($app,$id) = explode(':',$data['info_contact']); if (is_array($data['info_contact'])) $value = $data['info_contact']['title'];
if (!empty($app)&&!empty($id)) $value = Link::title($app,$id); }
} }
$details[$name] = array( $details[$name] = array(
'label' => lang($this->field2label[$name]), 'label' => lang($this->field2label[$name]),
@ -257,7 +258,7 @@ class infolog_tracking extends Api\Storage\Tracking
); );
// add custom fields for given type // add custom fields for given type
$details += $this->get_customfields($data, $data['info_type'], $receiver); $details += $this->get_customfields($data, $data['info_type'], $receiver);
error_log(__METHOD__."(".array2string($data).", $receiver) returning ".array2string($details));
return $details; return $details;
} }