From 71967b5ec4fb4c130e759f1b661f3414bed0c841 Mon Sep 17 00:00:00 2001 From: Baraka Kinywa Date: Fri, 1 Nov 2024 06:16:22 +0200 Subject: [PATCH] =?UTF-8?q?[FIX]Bulk-import=20accounts=20using=20yaml=20or?= =?UTF-8?q?=20csv=20template:=20Allow=20both=20text/csv=20and=20text/plain?= =?UTF-8?q?=20files=20to=20be=20parsed=20as=20CSV,=20accommodating=20Tiki?= =?UTF-8?q?=E2=80=99s=20MIME=20type=20handling?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/nux/modules.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/nux/modules.php b/modules/nux/modules.php index e5fc53f3a..9311d3ead 100644 --- a/modules/nux/modules.php +++ b/modules/nux/modules.php @@ -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']); @@ -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';