From 7e55000e84bc9d005f5861678b02360bdbfefe59 Mon Sep 17 00:00:00 2001 From: phl0 Date: Tue, 30 Apr 2024 17:34:11 +0200 Subject: [PATCH] Only update from LoTW if first 4-chars are different or grid string is longer --- application/controllers/Lotw.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) 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'])) {