Only update from LoTW if first 4-chars are different or grid string is

longer
This commit is contained in:
phl0
2024-04-30 17:34:11 +02:00
parent 2d4e790fb0
commit 7e55000e84

View File

@@ -524,15 +524,11 @@ class Lotw extends CI_Controller {
$state = "";
}
// Present only if the QSLing station specified a single valid grid square value in its station location uploaded to LoTW.
$qsl_gridsquare = "";
if (isset($record['gridsquare'])) {
// Only overwrite if incoming grid is at least of the same length/precision than existing in the QSO record
if (strlen($record['gridsquare']) >= strlen($status[2])) {
if (strlen($record['gridsquare']) > strlen($status[2]) || substr(strtoupper($status[2]), 0, 4) != substr(strtoupper($record['gridsquare']), 0, 4)) {
$qsl_gridsquare = $record['gridsquare'];
} else {
$qsl_gridsquare = "";
}
} else {
$qsl_gridsquare = "";
}
if (isset($record['vucc_grids'])) {