From e98ef6b49c7a2ffb2a23011215a6f76c8efb055f Mon Sep 17 00:00:00 2001 From: Franz Glauber Vanderlinde <franz.glauber@gmail.com> Date: Thu, 26 Apr 2012 09:03:01 -0300 Subject: [PATCH] =?UTF-8?q?Issue=20#1407670=20by=20Ivan=20Simonov,=20Ga?= =?UTF-8?q?=C3=ABlG,=20franz:=20drupal=5Fstrlen()=20doesn't=20work=20when?= =?UTF-8?q?=20parsing=20multibyte=20strings=20in=20CSVParser.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libraries/ParserCSV.inc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libraries/ParserCSV.inc b/libraries/ParserCSV.inc index e8cec487..08507537 100644 --- a/libraries/ParserCSV.inc +++ b/libraries/ParserCSV.inc @@ -214,7 +214,9 @@ class ParserCSV { $currentField = ''; $fields = array(); - while ($currentIndex <= drupal_strlen($line)) { + // We must use strlen() as we're parsing byte by byte using strpos(), so + // drupal_strlen() will not work properly. + while ($currentIndex <= strlen($line)) { if ($quoted) { $nextQuoteIndex = strpos($line, '"', $currentIndex); -- GitLab