From 00ada90163779da0624236506f6908af82ddfba2 Mon Sep 17 00:00:00 2001 From: Noel Dieschburg Date: Fri, 15 Jan 2010 17:05:10 +0100 Subject: [PATCH] CSV import : ignores the file blank lines (submitted by Laurent Bigonville) --- main/inc/lib/import.lib.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/main/inc/lib/import.lib.php b/main/inc/lib/import.lib.php index e7cf80d743..a8bf1ced85 100644 --- a/main/inc/lib/import.lib.php +++ b/main/inc/lib/import.lib.php @@ -57,14 +57,17 @@ class Import $row = array (); //avoid empty lines in csv if (is_array($row_tmp) && count($row_tmp)>0 && $row_tmp[0]!= '') { + if (!is_null($row_tmp[0])) + { foreach ($row_tmp as $index => $value) { $row[$keys[$index]] = $value; } $result[] = $row; - } + } + } } fclose($handle); return $result; } } -?> \ No newline at end of file +?>