Make sure info_contact is a string before trying to explode it

This commit is contained in:
Nathan Gray 2012-04-16 21:53:19 +00:00
parent 97035b359f
commit 4ab0a5a30d

View File

@ -1540,8 +1540,11 @@ class infolog_ui
if ($content['info_contact'])
{
$old_link_id = (int)$content['info_link_id'];
list($app,$id) = explode(':',$content['info_contact'], 2);
$content['info_link_id'] = (int)($info_link_id = egw_link::link('infolog',$content['link_to']['to_id'],$app,$id));
list($app,$id) = is_array($content['info_contact']) ? $content['info_contact'] : explode(':',$content['info_contact'], 2);
if($app && $id)
{
$content['info_link_id'] = (int)($info_link_id = egw_link::link('infolog',$content['link_to']['to_id'],$app,$id));
}
if ($old_link_id && $old_link_id != $content['info_link_id']) egw_link::unlink($old_link_id);
}
if (is_array($content['link_to']['to_id']) && count($content['link_to']['to_id']))