diff --git a/app/devices/device_imports.php b/app/devices/device_imports.php index 4b1e0e90be..23567a4054 100644 --- a/app/devices/device_imports.php +++ b/app/devices/device_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) 2018-2020 + Portions created by the Initial Developer are Copyright (C) 2018-2023 the Initial Developer. All Rights Reserved. Contributor(s): @@ -61,10 +61,10 @@ ini_set('max_execution_time',7200); //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"] ?? null; + $from_row = $_POST["from_row"] ?? null; + $delimiter = $_POST["data_delimiter"] ?? null; + $enclosure = $_POST["data_enclosure"] ?? null; //save the data to the csv file if (isset($_POST['data'])) { @@ -76,7 +76,7 @@ //copy the csv file //$_POST['submit'] == "Upload" && - if ( is_uploaded_file($_FILES['ulfile']['tmp_name']) && permission_exists('device_import')) { + if (!empty($_FILES['ulfile']['tmp_name']) && is_uploaded_file($_FILES['ulfile']['tmp_name']) && permission_exists('device_import')) { if ($_POST['type'] == 'csv') { $file = $_SESSION['server']['temp']['dir']."/devices-".$_SESSION['domain_name'].".csv"; if (move_uploaded_file($_FILES['ulfile']['tmp_name'], $file)) { @@ -114,7 +114,7 @@ $schema[$i]['table'] = $table_name; $schema[$i]['parent'] = $parent_name; foreach ($table['fields'] as $row) { - if ($row['deprecated'] !== 'true') { + if (empty($row['deprecated']) || $row['deprecated'] !== 'true') { if (is_array($row['name'])) { $field_name = $row['name']['text']; } @@ -492,7 +492,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";