Infolog: Avoid errors adding app replacements if incorrect parameters given

This commit is contained in:
nathan 2021-10-15 09:09:53 -06:00
parent 62aeccbb0f
commit 33fcb4e657
2 changed files with 6 additions and 2 deletions

View File

@ -1793,6 +1793,10 @@ abstract class Merge
public function get_app_replacements($app, $id, $content, $prefix = '')
{
$replacements = array();
if(!$app || $id || !$content)
{
return $replacements;
}
if($app == 'addressbook')
{
return $this->contact_replacements($id, $prefix, false, $content);

View File

@ -183,9 +183,9 @@ class infolog_merge extends Api\Storage\Merge
$info += $this->get_all_links('infolog', $id, $prefix, $content);
// Add contact fields
if($array['info_link'] && $array['info_link']['app'] && $array['info_link']['id'])
if($array['info_link'] && is_array($array['info_link']) && $array['info_link']['app'] && $array['info_link']['id'])
{
$info+=$this->get_app_replacements($array['info_link']['app'], $array['info_link']['id'], $content, 'info_contact');
$info += $this->get_app_replacements($array['info_link']['app'], $array['info_link']['id'], $content, 'info_contact');
}
// Add owner fields
$info += $this->contact_replacements(Api\Accounts::id2name($info_owner,'person_id'),'info_owner');