Bug #72646 [Ver->Csd]: SplFileObject::getCsvControl does not return the escape characters
| From: | cmb@php.net | Date: | Fri, 22 Jul 2016 13:30:37 +0000 |
| Subject: | Bug #72646 [Ver->Csd]: SplFileObject::getCsvControl does not return the escape characters | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-202504@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=72646&edit=1
ID: 72646
Updated by: cmb@php.net
Reported by: nyamsprod at gmail dot com
Summary: SplFileObject::getCsvControl does not return the
escape characters
-Status: Verified
+Status: Closed
Type: Bug
Package: SPL related
Operating System: Irrelevant
PHP Version: Irrelevant
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of cmb
Revision: http://git.php.net/?p=php-src.git;a=commit;h=6b116932b28b76c3f075921a0f2660f7bf5ac4e1
Log: Fix #72646: SplFileObject::getCsvControl does not return the escape character
Previous Comments:
------------------------------------------------------------------------
[2016-07-22 11:59:46] cmb@php.net
Confirmed: <https://3v4l.org/XTKF7>. That's
obviously been
forgotten when $escape was added to ::setCSVControl() in PHP 5.3.
The docs need respective updates also.
------------------------------------------------------------------------
[2016-07-22 08:10:32] nyamsprod at gmail dot com
Description:
------------
SplFileObject::setCsvControl takes 3 parameters
- the delimiter character
- the enclosure character
- the escape character
But the equivalent SplFileObject::getCsvControl returns an array with only two of those parameters.
The escape character is missing.
Test script:
---------------
<?php
$controls = (new SplTempFileObject())->getCsvControl();
print_r($controls);
Expected result:
----------------
Array
(
[0] => ,
[1] => "
[2] => "\"
)
Actual result:
--------------
Array
(
[0] => ,
[1] => "
)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=72646&edit=1