From f4e79928f6cbd291c9071b21723fbbfe8d942b57 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Mon, 2 Oct 2006 06:45:46 +0000 Subject: [PATCH] fixed link_query hook, it returned array('') instead of array() for nothing found --- addressbook/inc/class.bocontacts.inc.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/addressbook/inc/class.bocontacts.inc.php b/addressbook/inc/class.bocontacts.inc.php index 7b5d4a890f..699fa7148e 100755 --- a/addressbook/inc/class.bocontacts.inc.php +++ b/addressbook/inc/class.bocontacts.inc.php @@ -727,9 +727,12 @@ class bocontacts extends socontacts $criteria[$col] = $pattern; } } - foreach((array) parent::search($criteria,false,'org_name,n_family,n_given','','%',false,'OR') as $contact) + if (($contacts = parent::search($criteria,false,'org_name,n_family,n_given','','%',false,'OR'))) { - $result[$contact['id']] = $this->link_title($contact); + foreach($contacts as $contact) + { + $result[$contact['id']] = $this->link_title($contact); + } } return $result; }