diff --git a/api/src/Contacts.php b/api/src/Contacts.php index 7629623893..cad088301b 100755 --- a/api/src/Contacts.php +++ b/api/src/Contacts.php @@ -1509,12 +1509,16 @@ class Contacts extends Contacts\Storage $type = null; } $title = $this->fileas($contact,$type); - $field_list = is_string($this->prefs['link_title_cf']) ? explode(',', $this->prefs['link_title_cf']) : $this->prefs['link_title_cf']; - foreach ($field_list as $field) + + if (!empty($this->prefs['link_title_cf'])) { - if($contact['#'.$field]) + $field_list = is_string($this->prefs['link_title_cf']) ? explode(',', $this->prefs['link_title_cf']) : $this->prefs['link_title_cf']; + foreach ($field_list as $field) { - $title .= ', ' . $contact['#'.$field]; + if($contact['#'.$field]) + { + $title .= ', ' . $contact['#'.$field]; + } } } return $title ;