Skip to content

Commit

Permalink
Fix imput with no decimal point
Browse files Browse the repository at this point in the history
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".
  • Loading branch information
blockmurder committed Oct 15, 2019
1 parent a91db6b commit 244a64b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/WinLinkAPIExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 244a64b

Please sign in to comment.