allow just one character for "Fields enclosed by", thanks to Michal

This commit is contained in:
Marc Delisle
2008-01-30 13:13:37 +00:00
parent 98f9967a61
commit 908727c2a4

View File

@@ -53,10 +53,12 @@ if (strlen($csv_terminated) != 1) {
// tend to remove the enclosing character on the Import dialog. // tend to remove the enclosing character on the Import dialog.
// I could not find a test case where having no enclosing characters // I could not find a test case where having no enclosing characters
// confuses this script. // confuses this script.
//} elseif (strlen($csv_enclosed) != 1) { // But the parser won't work correctly with strings so we allow just
// $message = sprintf($strInvalidCSVParameter, $strFieldsEnclosedBy); // one character.
// $show_error_header = TRUE; } elseif (strlen($csv_enclosed) > 1) {
// $error = TRUE; $message = sprintf($strInvalidCSVParameter, $strFieldsEnclosedBy);
$show_error_header = TRUE;
$error = TRUE;
} elseif (strlen($csv_escaped) != 1) { } elseif (strlen($csv_escaped) != 1) {
$message = sprintf($strInvalidCSVParameter, $strFieldsEscapedBy); $message = sprintf($strInvalidCSVParameter, $strFieldsEscapedBy);
$show_error_header = TRUE; $show_error_header = TRUE;