Skip to content

Commit

Permalink
Merge pull request #1310 from Baraka24/ajust-MIME-type-check
Browse files Browse the repository at this point in the history
[FIX]Bulk-import accounts using yaml or csv template: Allow both text/csv and text/plain files to be parsed as CSV, accommodating Tiki’s MIME type handling
  • Loading branch information
Shadow243 authored Nov 3, 2024
2 parents abdd8aa + 71967b5 commit 070976c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/nux/modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ public function process()
$extension = pathinfo($this->request->files['accounts_sample']['name'], PATHINFO_EXTENSION);
if (in_array(strtolower($extension), ['yaml', 'yml'])) {
$servers = Yaml::parseFile($this->request->files['accounts_sample']['tmp_name']);
} elseif ($this->request->files['accounts_sample']['type'] == 'text/csv'){
} elseif (in_array($this->request->files['accounts_sample']['type'], ['text/csv', 'text/plain'])) {
$servers = [];
$server_data = parse_csv_with_headers($this->request->files['accounts_sample']['tmp_name']);

Expand Down Expand Up @@ -367,7 +367,7 @@ public function process()
continue;
}
}
}
}
if (! empty($server['smtp']['server'])) {
if (!$this->module_is_supported('smtp')) {
$errors[] = 'SMTP module is not enabled';
Expand Down

0 comments on commit 070976c

Please sign in to comment.