Merge pull request #729 from phl0/fixQraBearingFunction

Only calculate Lat/Lon if QRA loc has even number of chars
这个提交包含在:
Peter Goodhall 2020-12-06 21:25:03 +00:00 提交者 GitHub
当前提交 e3d2575606
找不到此签名对应的密钥
GPG 密钥 ID: 4AEE18F83AFDEB23

查看文件

@ -119,6 +119,7 @@ $var_dist = "";
function qra2latlong($strQRA)
{
if (strlen($strQRA) %2 == 0) {
$strQRA = strtoupper($strQRA);
if (strlen($strQRA) == 4) $strQRA .= "MM";
if (!preg_match('/^[A-Z]{2}[0-9]{2}[A-Z]{2}$/',$strQRA)) return false;
@ -133,6 +134,9 @@ function qra2latlong($strQRA)
$nLat = ($b*10) + $d + (($f+0.5)/24) - 90;
$arLatLong = array($nLat,$nLong);
return($arLatLong);
} else {
return array(0, 0);
}
}
/* End of file Qra.php */