Bug #66126 [NEW]: SplFileObject READ_CSV ignores multi line csv data
From: m dot gribben at yellowsatsuma dot com
Operating system: Ubuntu
PHP version: 5.4.22
Package: SPL related
Bug Type: Bug
Bug description:SplFileObject READ_CSV ignores multi line csv data
Description:
------------
When running SplFileObject with the READ_CSV flag set, it does not obey
the field enclosure setting (") and thus ignores any multi lined data in
the CSV file, IE any data field with new lines in it.
Test script:
---------------
https://gist.github.com/anonymous/7561146
Expected result:
----------------
I would expect the code to read the file as a CSV and when a field is
enclosed in the correct markup that its contents be treated as a single
line of CSV regardless of it having new lines in it.
Actual result:
--------------
The code correctly reads most lines but when a field contains a new line
it treats that as the end of that line of CSV, even when enclosed in
double quotes.
--
Edit bug report at https://bugs.php.net/bug.php?id=66126&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=66126&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=66126&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=66126&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=66126&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=66126&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=66126&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=66126&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=66126&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=66126&r=support
Expected behavior: https://bugs.php.net/fix.php?id=66126&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=66126&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=66126&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=66126&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=66126&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=66126&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=66126&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=66126&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=66126&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=66126&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=66126&r=mysqlcfg
Thread (2 messages)
- m dot gribben at yellowsatsuma dot com