#31580 [Asn->Opn]: fgetcsv: yet another doubled quote problem
| From: | iliaa@php.net | Date: | Tue, 18 Jan 2005 00:15:09 +0000 |
| Subject: | #31580 [Asn->Opn]: fgetcsv: yet another doubled quote problem | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-72341@lists.php.net to get a copy of this message | ||
ID: 31580
Updated by: iliaa@php.net
Reported By: rochkind at basepath dot com
-Status: Assigned
+Status: Open
Bug Type: Filesystem function related
Operating System: Gentoo Linux
PHP Version: 4.3.10
Assigned To: iliaa
New Comment:
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2005-01-17 18:43:00] sniper@php.net
See also bug #31074
------------------------------------------------------------------------
[2005-01-17 03:04:02] rochkind at basepath dot com
Description:
------------
Can't handle doubled-quote at the start of a quoted field when there is
another field following.
That is, does OK on the line:
z,"""x"
but not on the line:
z,"""x",yyy
Reproduce code:
---------------
<?php
$out = fopen("/tmp/csv", "w");
fputs($out, 'z,"""x"' . "\n");
fputs($out, 'z,"""x",yyy' . "\n");
fclose($out);
echo "<pre>";
system("cat /tmp/csv");
echo "</pre>";
$in = fopen("/tmp/csv", "r");
while ($a = fgetcsv($in, 200))
echo "<br>" . htmlspecialchars($a[1]);
fclose($in);
?>
Expected result:
----------------
z,"""x"
z,"""x",yyy
"x
"x
Actual result:
--------------
z,"""x"
z,"""x",yyy
"x
x
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=31580&edit=1