Fix #783 Csv separator detection nesting limit error. (#845)

This commit is contained in:
Laurentiu Dancu 2019-02-25 19:31:35 +02:00 committed by Mark Baker
parent f26023586e
commit 334afde9cd
1 changed files with 2 additions and 1 deletions

View File

@ -255,7 +255,8 @@ class Csv extends BaseReader
// Drop everything that is enclosed to avoid counting false positives in enclosures // Drop everything that is enclosed to avoid counting false positives in enclosures
$enclosure = preg_quote($this->enclosure, '/'); $enclosure = preg_quote($this->enclosure, '/');
$line = preg_replace('/(' . $enclosure . '.*' . $enclosure . ')/U', '', $line); // Add 's' to the replace rule in order for '.' to also match newline.
$line = preg_replace('/(' . $enclosure . '.*' . $enclosure . ')/Us', '', $line);
// See if we have any enclosures left in the line // See if we have any enclosures left in the line
// if we still have an enclosure then we need to read the next line as well // if we still have an enclosure then we need to read the next line as well