GH-879 Bug in file PHPExcel/Reader/CSV.php

Code logic identifying a defined separator when no separator is explicitly defined
Case-insensitive check when separator is explicitly defined
This commit is contained in:
MarkBaker 2016-04-14 23:20:07 +01:00
parent 343955453a
commit 3bb541c610
1 changed files with 4 additions and 3 deletions

View File

@ -163,10 +163,11 @@ class CSV extends BaseReader implements IReader
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();
}
/**