php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #72646 SplFileObject::getCsvControl does not return the escape characters
Submitted: 2016-07-22 08:10 UTC Modified: 2016-07-22 11:59 UTC
From: nyamsprod at gmail dot com Assigned: cmb (profile)
Status: Closed Package: SPL related
PHP Version: Irrelevant OS: Irrelevant
Private report: No CVE-ID: None
 [2016-07-22 08:10 UTC] 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] => "
)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-07-22 11:59 UTC] cmb@php.net
-Status: Open +Status: Verified -Assigned To: +Assigned To: cmb
 [2016-07-22 11:59 UTC] 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 13:30 UTC] cmb@php.net
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
 [2016-07-22 13:30 UTC] cmb@php.net
-Status: Verified +Status: Closed
 [2016-07-22 13:35 UTC] cmb@php.net
Automatic comment from SVN on behalf of cmb
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=339699
Log: Fix #72646: SplFileObject::getCsvControl does not return the escape characters
 [2016-10-17 10:10 UTC] bwoebi@php.net
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
 [2020-02-07 06:07 UTC] phpdocbot@php.net
Automatic comment on behalf of cmb
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=e0a6752d35036d3ddff48b831e49248066730728
Log: Fix #72646: SplFileObject::getCsvControl does not return the escape characters
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 17:01:58 2024 UTC