diff --git a/application/controllers/Lotw.php b/application/controllers/Lotw.php index c6c82c1d1..eb2eba33f 100644 --- a/application/controllers/Lotw.php +++ b/application/controllers/Lotw.php @@ -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'])) {