mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 05:02:36 +01:00
Merge pull request #9127 from turbo124/v5-develop
Updates for delimiter detection
This commit is contained in:
commit
9fee64018d
@ -140,6 +140,10 @@ class BaseImport
|
||||
$delimiters = [',', '.', ';', '|'];
|
||||
$bestDelimiter = ',';
|
||||
$count = 0;
|
||||
|
||||
// 10-01-2024 - A better way to resolve the csv file delimiter.
|
||||
$csvfile = substr($csvfile, 0, strpos($csvfile, "\n"));
|
||||
|
||||
foreach ($delimiters as $delimiter) {
|
||||
|
||||
if (substr_count(strstr($csvfile, "\n", true), $delimiter) >= $count) {
|
||||
@ -162,7 +166,6 @@ class BaseImport
|
||||
|
||||
private function groupTasks($csvData, $key)
|
||||
{
|
||||
nlog($csvData[0]);
|
||||
|
||||
if (! $key || !is_array($csvData) || count($csvData) == 0 || !isset($csvData[0]['task.number']) || empty($csvData[0]['task.number'])) {
|
||||
return $csvData;
|
||||
|
@ -180,4 +180,4 @@
|
||||
],
|
||||
"minimum-stability": "dev",
|
||||
"prefer-stable": true
|
||||
}
|
||||
}
|
@ -1,3 +1,4 @@
|
||||
{
|
||||
"Admin": true
|
||||
}
|
||||
"Admin": true,
|
||||
"Ronin": true
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user