Fixed problem when importing fewer than 5 fields.
[squirrelmail.git] / src / addressbook_csvimport.php
index d98d698da09a22240cf0a04dc81a53fb799caef7..1dc1f1e29b52d5060bd6300c8628c19f4d3a41de 100644 (file)
    // This loop sets up a table of the data they uploaded to save time while the user rearranges it.
        $row = 0;
        do {
-          ($data = fgetcsv($fp, 4096));                
-          $cols = count($data);
+          ($data = fgetcsv($fp, 4096));
+          if(count($data) >= 5) {
+             $cols = count($data);
+          } else {
+             $cols = 5;
+          }            
+//        $cols = count($data);
           $row++;
           
           if($flag == 0 && !$finish) {                            // Table header on initial import