The branch, master has been updated via 786358531b7315c9f664f4611c5612a5caff9234 (commit) from 82aa0b7dc1ea3294b2cba2ac84f39143e5b36481 (commit)
- Log ----------------------------------------------------------------- commit 786358531b7315c9f664f4611c5612a5caff9234 Author: Yuichiro yuichiro@pop07.odn.ne.jp Date: Sun Jan 22 04:24:03 2012 -0500
patch #3475424 [import] Fixed CSV escape for the import
-----------------------------------------------------------------------
Summary of changes: ChangeLog | 1 + libraries/config.default.php | 2 +- libraries/import/csv.php | 7 ++++++- 3 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog index 898e6b4..29cdd12 100644 --- a/ChangeLog +++ b/ChangeLog @@ -69,6 +69,7 @@ phpMyAdmin - ChangeLog - bug #3093145 [display] Page through rows returned from a view + patch #3303195 [interface] Checkbox to have SQL input remain - patch #3472899 [export] Fixed CSV escape for the export +- patch #3475424 [import] Fixed CSV escape for the import
3.4.10.0 (not yet released) - bug #3460090 [interface] TextareaAutoSelect feature broken diff --git a/libraries/config.default.php b/libraries/config.default.php index 83387c9..1821565 100644 --- a/libraries/config.default.php +++ b/libraries/config.default.php @@ -1955,7 +1955,7 @@ $cfg['Import']['csv_enclosed'] = '"'; * * @global string $cfg['Import']['csv_escaped'] */ -$cfg['Import']['csv_escaped'] = '\'; +$cfg['Import']['csv_escaped'] = '"';
/** * diff --git a/libraries/import/csv.php b/libraries/import/csv.php index 019412d..79e1cd3 100644 --- a/libraries/import/csv.php +++ b/libraries/import/csv.php @@ -223,7 +223,7 @@ while (!($finished && $i >= $len) && !$error && !$timeout_passed) { } $fail = false; $value = ''; - while (($need_end && $ch != $csv_enclosed) + while (($need_end && ($ch != $csv_enclosed || $csv_enclosed == $csv_escaped)) || (!$need_end && !($ch == $csv_terminated || $ch == $csv_new_line || ($csv_new_line == 'auto' && ($ch == "\r" || $ch == "\n"))))) { @@ -234,6 +234,11 @@ while (!($finished && $i >= $len) && !$error && !$timeout_passed) { } $i++; $ch = $buffer[$i]; + if ($csv_enclosed == $csv_escaped && ($ch == $csv_terminated + || $ch == $csv_new_line || ($csv_new_line == 'auto' + && ($ch == "\r" || $ch == "\n")))) { + break; + } } $value .= $ch; if ($i == $len - 1) {
hooks/post-receive