From 8f815a951e1bdbf33005200ed4381b8f2fc18a1c Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Mon, 1 Mar 2010 15:53:47 +0000 Subject: [PATCH] Fix infinite loop if no sample file provided, default field separator to ; --- .../importexport/class.wizzard_import_contacts_csv.inc.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addressbook/importexport/class.wizzard_import_contacts_csv.inc.php b/addressbook/importexport/class.wizzard_import_contacts_csv.inc.php index 53a14b353b..ad57704b8d 100644 --- a/addressbook/importexport/class.wizzard_import_contacts_csv.inc.php +++ b/addressbook/importexport/class.wizzard_import_contacts_csv.inc.php @@ -90,11 +90,10 @@ class wizzard_import_contacts_csv extends import_contacts_csv if (($handle = fopen($GLOBALS['egw']->session->appsession('csvfile'), "rb")) !== FALSE) { $data = fgetcsv($handle, 8000, $content['fieldsep']); $content['csv_fields'] = translation::convert($data,$content['charset']); - return $GLOBALS['egw']->uidefinitions->get_step($content['step'],1); } elseif($content['plugin_options']['csv_fields']) { $content['csv_fields'] = $content['plugin_options']['csv_fields']; } - return $this->wizzard_step40($content,$sel_options,$readonlys,$preserv); + return $GLOBALS['egw']->uidefinitions->get_step($content['step'],1); case 'previous' : return $GLOBALS['egw']->uidefinitions->get_step($content['step'],-1); case 'finish': @@ -112,6 +111,8 @@ class wizzard_import_contacts_csv extends import_contacts_csv // If editing an existing definition, these will be in plugin_options if(!$content['fieldsep'] && $content['plugin_options']['fieldsep']) { $content['fieldsep'] = $content['plugin_options']['fieldsep']; + } elseif (!$content['fieldsep']) { + $content['fieldsep'] = ';'; } if(!$content['charset'] && $content['plugin_options']['charset']) { $content['charset'] = $content['plugin_options']['charset'];