From a91db6b93710227aa8c112f7486ba154bc283fbf Mon Sep 17 00:00:00 2001 From: blockmurder Date: Tue, 15 Oct 2019 17:53:52 +0100 Subject: [PATCH 1/2] Bumped version number to 0.1.3 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index ee4d592..adf022a 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "blockmurder/winlinkapi", "description": "Adds a cron job which gets the latest poition reports of your callsing from WinLink.org and adds them to your database", "type": "bolt-extension", - "version": "0.1.2", + "version": "0.1.3", "keywords": [ "winlink", "positions", From 244a64b78582c9c35503d93a9d751908ccb190c7 Mon Sep 17 00:00:00 2001 From: blockmurder Date: Tue, 15 Oct 2019 17:55:35 +0100 Subject: [PATCH 2/2] Fix imput with no decimal point If function imput does NOT have decimal point, calling $vars[1] will throw an exception. Make sure imput ($deg) has decimal point (count >1). Otherwise set tempma "0.0". --- src/WinLinkAPIExtension.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/WinLinkAPIExtension.php b/src/WinLinkAPIExtension.php index 1ed2e36..0d7b5a9 100644 --- a/src/WinLinkAPIExtension.php +++ b/src/WinLinkAPIExtension.php @@ -220,7 +220,13 @@ private function ddToDms($dec) // Converts decimal format to DMS ( Degrees / minutes / seconds ) $vars = explode(".",$dec); $deg = $vars[0]; - $tempma = "0.".$vars[1]; + + if(count($vars)>1) + { + $tempma = "0.".$vars[1]; + }else{ + $tempma = "0.0"; + } $tempma = $tempma * 3600; $min = floor($tempma / 60);