Merge pull request #1347 from ashutoshdhundhara/bug_4527
Bug #4527: Importing ODS files with column names having trailing spaces fails.
This commit is contained in:
commit
54f80bfd7f
@ -582,6 +582,10 @@ class ImportCsv extends AbstractImportCsv
|
||||
if (isset($_REQUEST['csv_col_names'])) {
|
||||
$col_names = array_splice($rows, 0, 1);
|
||||
$col_names = $col_names[0];
|
||||
// MySQL column names can't end with a space character.
|
||||
foreach ($col_names as $key => $col_name) {
|
||||
$col_names[$key] = rtrim($col_name);
|
||||
}
|
||||
}
|
||||
|
||||
if ((isset($col_names) && count($col_names) != $max_cols)
|
||||
|
||||
@ -224,7 +224,9 @@ class ImportOds extends ImportPlugin
|
||||
if (! $col_names_in_first_row) {
|
||||
$tempRow[] = $value;
|
||||
} else {
|
||||
$col_names[] = $value;
|
||||
// MySQL column names can't end with a space
|
||||
// character.
|
||||
$col_names[] = rtrim($value);
|
||||
}
|
||||
|
||||
++$col_count;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user