diff --git a/CHANGELOG.md b/CHANGELOG.md index eccbe64..5cdc6c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -60,6 +60,7 @@ v2.0 - Fix FLEXIAPI-342 Enforce password change when the External Account domain is changed - Fix FLEXIAPI-346 Complete the supporting text for the provisioning ini field - Fix FLEXIAPI-350 Fix wrongly assigned variables in some views +- Fix FLEXIAPI-351 Fix import of CSV generated on Windows v1.6 ---- diff --git a/flexiapi/app/Http/Controllers/Admin/AccountImportController.php b/flexiapi/app/Http/Controllers/Admin/AccountImportController.php index 3b14223..4724273 100644 --- a/flexiapi/app/Http/Controllers/Admin/AccountImportController.php +++ b/flexiapi/app/Http/Controllers/Admin/AccountImportController.php @@ -67,7 +67,9 @@ class AccountImportController extends Controller $lines = collect(); $this->errors['Wrong file format'] = "The number of columns doesn't matches the reference file. The first MUST be the same as the reference file"; - if ($line == "Username,Password,Role,Status,Phone,Email,External Username,External Domain,External Password,External Realm, External Registrar,External Outbound Proxy,External Protocol\n") { + $firstLine = 'Username,Password,Role,Status,Phone,Email,External Username,External Domain,External Password,External Realm, External Registrar,External Outbound Proxy,External Protocol'; + + if (substr($line, 0, strlen($firstLine)) == $firstLine) { $lines = $this->csvToCollection($request->file('csv')); unset($this->errors['Wrong file format']); }