Skip to content

Commit

Permalink
Merge pull request #57 from savefork/master
Browse files Browse the repository at this point in the history
#56 compatible with PHP >= 5.5.19, add useless  parameter to fputcsv
  • Loading branch information
reoring committed Feb 2, 2015
2 parents 66c376b + ec38d68 commit b289ca3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Goodby/CSV/Export/Standard/CsvFileObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@ public function setCsvFilter($filter)
* @param array $fields
* @param string $delimiter
* @param string $enclosure
* @param useless $escape THIS PARAM IS UNSED, BUT REQUIRED EXISTS, see https://bugs.php.net/bug.php?id=68479 and https://github.com/goodby/csv/issues/56
* @return int|void
*/
public function fputcsv($fields, $delimiter = null, $enclosure = null)
public function fputcsv($fields, $delimiter = null, $enclosure = null, $escape = null)
{
// Temporary output a line to memory to get line as string
$fp = fopen('php://temp', 'w+');
Expand All @@ -69,12 +70,12 @@ public function fputcsv($fields, $delimiter = null, $enclosure = null)
* with what the client code wishes.
*/
$line = rtrim($line, "\n"). $this->newline;

// if the enclosure was '' | false
if (empty($enclosure)) {
$line = str_replace("\0", '', $line);
}

if ( is_callable($this->csvFilter) ) {
$line = call_user_func($this->csvFilter, $line);
}
Expand Down

0 comments on commit b289ca3

Please sign in to comment.