diff --git a/core/users/user_imports.php b/core/users/user_imports.php index 971c0de7fa..d0bfa42444 100644 --- a/core/users/user_imports.php +++ b/core/users/user_imports.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2008-2020 + Portions created by the Initial Developer are Copyright (C) 2008-2023 the Initial Developer. All Rights Reserved. Contributor(s): @@ -58,10 +58,10 @@ } //get the http get values and set them as php variables - $action = $_POST["action"]; - $from_row = $_POST["from_row"]; - $delimiter = $_POST["data_delimiter"]; - $enclosure = $_POST["data_enclosure"]; + $action = $_POST["action"] ?? ''; + $from_row = $_POST["from_row"] ?? ''; + $delimiter = $_POST["data_delimiter"] ?? ''; + $enclosure = $_POST["data_enclosure"] ?? ''; //save the data to the csv file if (isset($_POST['data'])) { @@ -73,8 +73,8 @@ //copy the csv file //$_POST['submit'] == "Upload" && - if (is_uploaded_file($_FILES['ulfile']['tmp_name']) && permission_exists('user_import')) { - if ($_POST['type'] == 'csv') { + if (!empty($_FILES['ulfile']['tmp_name']) && is_uploaded_file($_FILES['ulfile']['tmp_name']) && permission_exists('user_import')) { + if (!empty($_POST['type']) && $_POST['type'] == 'csv') { $file = $_SESSION['server']['temp']['dir'].'/users-'.$_SESSION['domain_name'].'.csv'; if (move_uploaded_file($_FILES['ulfile']['tmp_name'], $file)) { $_SESSION['file'] = $file; @@ -115,6 +115,7 @@ $schema[$i]['table'] = $table_name; $schema[$i]['parent'] = $parent_name; foreach($table['fields'] as $row) { + $row['deprecated'] = $row['deprecated'] ?? ''; if ($row['deprecated'] !== 'true') { if (is_array($row['name'])) { $field_name = $row['name']['text']; @@ -378,7 +379,7 @@ //exit; //save to the data - if (is_array($array)) { + if (!empty($array)) { $database = new database; $database->app_name = 'users'; $database->app_uuid = '4efa1a1a-32e7-bf83-534b-6c8299958a8e'; @@ -423,7 +424,7 @@ echo " ".$text['label-import_data']."\n"; echo "\n"; echo "\n"; - echo " \n"; + echo " \n"; echo "
\n"; echo $text['description-import_data']."\n"; echo "\n";