Skip to content
This repository has been archived by the owner on Jan 2, 2019. It is now read-only.

Commit

Permalink
GH-879 Bug in file PHPExcel/Reader/CSV.php
Browse files Browse the repository at this point in the history
Code logic identifying a defined separator when no separator is explicitly defined
Case-insensitive check when separator is explicitly defined
  • Loading branch information
MarkBaker committed Apr 14, 2016
1 parent 3439554 commit 3bb541c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/PhpSpreadsheet/Reader/CSV.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,11 @@ protected function checkSeparator()
return;
}

if ((strlen(trim($line)) == 5) && (strpos($line, 'sep=') !== 0)) {
return $this->skipBOM();
if ((strlen(trim($line, "\r\n")) == 5) && (stripos($line, 'sep=') === 0)) {
$this->delimiter = substr($line, 4, 1);
return;
}
$this->delimiter = substr($line, 4, 1);
return $this->skipBOM();
}

/**
Expand Down

0 comments on commit 3bb541c

Please sign in to comment.