From 98f9967a61b1a0aef576a31a766dcd37bbd68a64 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Tue, 29 Jan 2008 18:05:59 +0000 Subject: [PATCH] bug [import] Do not verify a missing enclosing character for CSV --- ChangeLog | 2 ++ libraries/import/csv.php | 14 ++++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 21527d379..43f52503f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -16,6 +16,8 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA - bug #1875010 [auth] MySQL server and client version mismatch (mysql ext.) - patch #1879031 [transform] dateformat transformation and UNIX timestamps, thanks to Tim Steiner - spam38 +- bug [import] Do not verify a missing enclosing character for CSV, + because files generated by Excel don't have any enclosing character 2.11.4.0 (2008-01-12) - bug #1843428 [GUI] Space issue with DROP/DELETE/ALTER TABLE diff --git a/libraries/import/csv.php b/libraries/import/csv.php index 034b1ae5c..a6457bf34 100644 --- a/libraries/import/csv.php +++ b/libraries/import/csv.php @@ -47,10 +47,16 @@ if (strlen($csv_terminated) != 1) { $message = sprintf($strInvalidCSVParameter, $strFieldsTerminatedBy); $show_error_header = TRUE; $error = TRUE; -} elseif (strlen($csv_enclosed) != 1) { - $message = sprintf($strInvalidCSVParameter, $strFieldsEnclosedBy); - $show_error_header = TRUE; - $error = TRUE; + // The default dialog of MS Excel when generating a CSV produces a + // semi-colon-separated file with no chance of specifying the + // enclosing character. Thus, users who want to import this file + // tend to remove the enclosing character on the Import dialog. + // I could not find a test case where having no enclosing characters + // confuses this script. +//} elseif (strlen($csv_enclosed) != 1) { +// $message = sprintf($strInvalidCSVParameter, $strFieldsEnclosedBy); +// $show_error_header = TRUE; +// $error = TRUE; } elseif (strlen($csv_escaped) != 1) { $message = sprintf($strInvalidCSVParameter, $strFieldsEscapedBy); $show_error_header = TRUE;