PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » File Formats » File_CSV » Bug #5257

File_CSV: delimiter problem if first field is empty

Details

Submitted2005-08-31 15:02 UTC
Fromionut at browse dot ro
Assigneddufuz
StatusClosed
PackageFile_CSV
PHP Version5.0.3
OSlinux
Roadmaps(Not assigned)

Comments

[2005-08-31 15:02 UTC] ionut at browse dot ro

Description:
------------
If the CSV file contains a row with the first field empty then the whole row is shifted with 1 column and the first comma appears in the second field.

Test script:
---------------
At line 240 the test logic needed change. Was:

if (!$in_quote && ($c == $conf['sep'] || $c == "\n" || $c == "\r") && $prev != '') {

Changed to:

if (!$in_quote && ((($c == "\n" || $c == "\r") && $prev != '') || ($c == $conf['sep']) ) ) {

After the modification the