bug [import] Do not verify a missing enclosing character for CSV

This commit is contained in:
Marc Delisle
2008-01-29 18:05:59 +00:00
parent 55a163dfeb
commit 98f9967a61
2 changed files with 12 additions and 4 deletions

View File

@@ -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;