Bug #78907 [NEW]: SplFileObject::fgetcsv() truncates data after CR char
From: pandenitz at mail dot ru
Operating system: Ubuntu 16.0.4
PHP version: Irrelevant
Package: SPL related
Bug Type: Bug
Bug description:SplFileObject::fgetcsv() truncates data after CR char
Description:
------------
Tested on PHP 7.1.26 - 7.4.0
See https://3v4l.org/k1B5Y
The initial CSV file has CRLF line breaks.
4th row (starting from 0) has CR inside.
The parser truncates the chars after this CR and the line is
incompletely parsed into an array.
Test script:
---------------
https://3v4l.org/k1B5Y
Expected result:
----------------
The row should be parsed correctly with an array element that contains
CR inside because CRLF is the real linebreak.
Actual result:
--------------
The row is truncated after CR.
--
Edit bug report at https://bugs.php.net/bug.php?id=78907&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=78907&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=78907&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=78907&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=78907&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=78907&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=78907&r=support
Expected behavior: https://bugs.php.net/fix.php?id=78907&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=78907&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=78907&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=78907&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=78907&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=78907&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=78907&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=78907&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=78907&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=78907&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=78907&r=mysqlcfg
Thread (6 messages)
- pandenitz at mail dot ru