From 9b440c99fa268e4b966d12d2ccf34fc47d1437e4 Mon Sep 17 00:00:00 2001 From: Emmanuel Gautier Date: Tue, 8 Oct 2013 13:55:12 +0200 Subject: [PATCH] Bug fix: error when the last line is empty --- src/Goodby/CSV/Import/Standard/Lexer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Goodby/CSV/Import/Standard/Lexer.php b/src/Goodby/CSV/Import/Standard/Lexer.php index 6b602b2..e4f5333 100644 --- a/src/Goodby/CSV/Import/Standard/Lexer.php +++ b/src/Goodby/CSV/Import/Standard/Lexer.php @@ -55,7 +55,7 @@ public function parse($filename, InterpreterInterface $interpreter) setlocale(LC_ALL, 'en_US.UTF-8'); foreach ( $csv as $lineNumber => $line ) { - if ($ignoreHeader && $lineNumber == 0) { + if ($ignoreHeader && $lineNumber == 0 || (count($line) === 1 && empty($line[0]))) { continue; } $interpreter->interpret($line);