From dc5e1437f038f072b299556887af2e304cc978b4 Mon Sep 17 00:00:00 2001 From: Miles Lott Date: Thu, 22 Feb 2001 15:13:29 +0000 Subject: [PATCH] Add check to see if extra_fields variable exists --- addressbook/inc/class.contacts_sql.inc.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/addressbook/inc/class.contacts_sql.inc.php b/addressbook/inc/class.contacts_sql.inc.php index a22787dd5f..45c787d02e 100644 --- a/addressbook/inc/class.contacts_sql.inc.php +++ b/addressbook/inc/class.contacts_sql.inc.php @@ -365,14 +365,16 @@ } reset($stock_fields); - reset($extra_fields); + if ($extra_fields) { reset($extra_fields); } // create strings for insertion into crosstable query below while(list($name,$value)=each($stock_fields)) { $std .= "a.".$name.","; } //$std = substr($std,0,-1); - while(list($name,$value)=each($extra_fields)) { - $ext .= "b.".$name.","; + if ($extra_fields) { + while(list($name,$value)=each($extra_fields)) { + $ext .= "b.".$name.","; + } } //$ext = substr($ext,0,-1); if (!empty($fieldlist2)) {