From 0352d0136620b3cbdbeabbfd78cc0408e0c0862a Mon Sep 17 00:00:00 2001 From: phl0 Date: Tue, 16 Jan 2024 00:16:58 +0100 Subject: [PATCH] Also take care of existing VUCC_GRIDS stored with whitespace --- application/libraries/Qra.php | 2 +- application/views/view_log/qso.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/application/libraries/Qra.php b/application/libraries/Qra.php index 38359c06..928e2eee 100644 --- a/application/libraries/Qra.php +++ b/application/libraries/Qra.php @@ -173,7 +173,7 @@ function get_bearing($lat1, $lon1, $lat2, $lon2) { } function qra2latlong($strQRA) { - $strQRA=trim($strQRA); + $strQRA=preg_replace('/\s+/', '', $strQRA); if (substr_count($strQRA, ',') > 0) { if (substr_count($strQRA, ',') == 3) { // Handle grid corners diff --git a/application/views/view_log/qso.php b/application/views/view_log/qso.php index a2f83dbf..06a4b93e 100644 --- a/application/views/view_log/qso.php +++ b/application/views/view_log/qso.php @@ -433,9 +433,9 @@ $distancestring = "(Gridsquare: ".$row->COL_GRIDSQUARE." / distance: ".$distance.")"; } else { if (substr_count($row->COL_VUCC_GRIDS, ',') == 1) { - $distancestring = "(Gridline: ".$row->COL_VUCC_GRIDS." / distance: ".$distance.")"; + $distancestring = "(Gridline: ".preg_replace('/\s+/', '', $row->COL_VUCC_GRIDS)." / distance: ".$distance.")"; } else if (substr_count($row->COL_VUCC_GRIDS, ',') == 3) { - $distancestring = "(Gridcorner: ".$row->COL_VUCC_GRIDS." / distance: ".$distance.")"; + $distancestring = "(Gridcorner: ".preg_replace('/\s+/', '', $row->COL_VUCC_GRIDS)." / distance: ".$distance.")"; } else { $distancestring = "(Grids: ".$row->COL_VUCC_GRIDS.")"; }