From a001f2773071ea82932ed423ea4ee13e711b8a77 Mon Sep 17 00:00:00 2001 From: Anthony <96078404+AntoniusDC@users.noreply.github.com> Date: Fri, 26 May 2023 16:25:07 -0600 Subject: [PATCH] Update voicemail_imports.php (#6724) * Update voicemail_imports.php --- app/voicemails/voicemail_imports.php | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/app/voicemails/voicemail_imports.php b/app/voicemails/voicemail_imports.php index 5801b09508..39725a6c54 100644 --- a/app/voicemails/voicemail_imports.php +++ b/app/voicemails/voicemail_imports.php @@ -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"] ?? ''; + $from_row = $_POST["from_row"] ?? ''; + $delimiter = $_POST["data_delimiter"] ?? ''; + $enclosure = $_POST["data_enclosure"] ?? ''; //save the data to the csv file if (isset($_POST['data'])) { @@ -75,7 +75,7 @@ //copy the csv file //$_POST['submit'] == "Upload" && - if (is_uploaded_file($_FILES['ulfile']['tmp_name']) && permission_exists('voicemail_import')) { + if (!empty($_FILES['ulfile']['tmp_name']) && is_uploaded_file($_FILES['ulfile']['tmp_name']) && permission_exists('voicemail_import')) { if ($_POST['type'] == 'csv') { move_uploaded_file($_FILES['ulfile']['tmp_name'], $_SESSION['server']['temp']['dir'].'/'.$_FILES['ulfile']['name']); $save_msg = "Uploaded file to ".$_SESSION['server']['temp']['dir']."/". htmlentities($_FILES['ulfile']['name']); @@ -108,10 +108,10 @@ //remove the v_ table prefix if (substr($table_name, 0, 2) == 'v_') { - $table_name = substr($table_name, 2); + $table_name = substr($table_name, 2); } if (substr($parent_name, 0, 2) == 'v_') { - $parent_name = substr($parent_name, 2); + $parent_name = substr($parent_name, 2); } //filter for specific tables and build the schema array @@ -119,6 +119,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']; @@ -231,7 +232,7 @@ } //upload the csv - if (file_exists($_SESSION['file']) && $action == 'import') { + if (file_exists($_SESSION['file'] ?? '') && $action == 'import') { //validate the token $token = new token; @@ -364,7 +365,7 @@ echo " ".$text['label-import_data']."\n"; echo "\n"; echo "