From: [EMAIL PROTECTED]
Operating system:
PHP version: 4.3.0
PHP Bug Type: Scripting Engine problem
Bug description: fgetcsv hangs if the csv file contains a "
Usings the basic fgetcsv example,
<?php
$row = 1;
$fp = fopen ("test.csv","r");
while ($data = fgetcsv ($fp, 1000, ",")) {
$num = count ($data);
print "<p> $num fields in line $row: <br>\n";
$row++;
for ($c=0; $c < $num; $c++) {
print $data[$c] . "<br>\n";
}
}
fclose ($fp);
?>
If the CSV contains a double quote, fgetcsv hangs on that line and memory
utilization spikes. I have reproduced this.
--
Edit bug report at http://bugs.php.net/?id=21556&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=21556&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=21556&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=21556&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=21556&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=21556&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=21556&r=support
Expected behavior: http://bugs.php.net/fix.php?id=21556&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=21556&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=21556&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=21556&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=21556&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=21556&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=21556&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=21556&r=gnused