diff --git a/application/controllers/Adif.php b/application/controllers/Adif.php
index ce2cca170..dcdcaafbc 100644
--- a/application/controllers/Adif.php
+++ b/application/controllers/Adif.php
@@ -193,7 +193,7 @@ class adif extends CI_Controller {
$f_elements=explode(".",$fdata['upload_data']['file_name']);
if (strtolower($f_elements[count($f_elements)-1])=='zip') {
$f_adif = preg_replace('/\\.zip$/', '', $fdata['upload_data']['file_name']);
- $p_adif = preg_replace('/^(.*)(_)(\S{2,4})$/', '$1.$3', $f_adif); // Bug in CodeIgniter. Destroys Filename if there is more than one dot.
+ $p_adif = hash('sha256', $this->session->userdata('user_callsign') ).'.adif';
if (preg_match("/.*\.adi.?$/",strtolower($p_adif))) { // Check if adi? inside zip
$zip = new ZipArchive;
if ($zip->open('./uploads/'.$fdata['upload_data']['file_name'])) {
diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php
index 324530e8f..2ca067999 100755
--- a/application/models/Logbook_model.php
+++ b/application/models/Logbook_model.php
@@ -3215,13 +3215,15 @@ function lotw_last_qsl_date($user_id) {
$a_qsos=[];
foreach ($records as $record) {
$one_error = $this->logbook_model->import($record, $station_id, $skipDuplicate, $markClublog, $markLotw,$dxccAdif, $markQrz, $markHrd, $skipexport, $operatorName, $apicall, $skipStationCheck, true);
- if ($one_error['error'] != '') {
+ if ($one_error['error'] ?? '' != '') {
$custom_errors.=$one_error['error']."
";
} else {
- array_push($a_qsos,$one_error['raw_qso']);
+ array_push($a_qsos,$one_error['raw_qso'] ?? '');
}
}
- $this->db->insert_batch($this->config->item('table_name'), $a_qsos);
+ if (count($a_qsos)>0) {
+ $this->db->insert_batch($this->config->item('table_name'), $a_qsos);
+ }
return $custom_errors;
}
/*
@@ -3245,10 +3247,10 @@ function lotw_last_qsl_date($user_id) {
if (($station_id !=0 ) && (!(isset($record['station_callsign'])))) {
$record['station_callsign']=$station_profile_call;
}
-
if ((!$skipStationCheck) && ($station_id != 0) && (strtoupper($record['station_callsign']) != strtoupper($station_profile_call))) { // Check if station_call from import matches profile ONLY when submitting via GUI.
- return "Wrong station callsign \"".htmlentities($record['station_callsign'])."\" while importing QSO with ".$record['call']." for ".$station_profile_call." : SKIPPED" .
+ $returner['error']="Wrong station callsign \"".htmlentities($record['station_callsign'] ?? '')."\" while importing QSO with ".$record['call'] ?? ''." for ".$station_profile_call ?? ''." : SKIPPED" .
"
See the Wavelog Wiki for hints about errors in ADIF files.";
+ return($returner);
}
$this->load->library('frequency');
diff --git a/application/views/adif/import.php b/application/views/adif/import.php
index a93c36a80..70873d466 100644
--- a/application/views/adif/import.php
+++ b/application/views/adif/import.php
@@ -56,6 +56,7 @@
B.