Merge branch 'wip-MDL-36113-master' of git://github.com/abgreeve/moodle

Conflicts:
	lib/tests/csvclass_test.php
This commit is contained in:
Dan Poltawski
2012-11-07 15:40:06 +08:00
2 changed files with 27 additions and 1 deletions
+9 -1
View File
@@ -110,7 +110,15 @@ class csv_import_reader {
// str_getcsv doesn't iterate through the csv data properly. It has
// problems with line returns.
while ($fgetdata = fgetcsv($fp, 0, $csv_delimiter, $enclosure)) {
$columns[] = $fgetdata;
// Check to see if we have an empty line.
if (count($fgetdata) == 1) {
if ($fgetdata[0] !== null) {
// The element has data. Add it to the array.
$columns[] = $fgetdata;
}
} else {
$columns[] = $fgetdata;
}
}
$col_count = 0;