[QRA] Check length of the gridsquare isn't greater than 6 chars
This fixes #934 as Cloudlog bearings only works for squares that are less than 6 chars.
这个提交包含在:
父节点
e3ba7411aa
当前提交
4c9ba52a9b
共有 1 个文件被更改,包括 7 次插入 和 5 次删除
|
|
@ -23,12 +23,14 @@ class Qra {
|
||||||
|
|
||||||
// calculate the bearing between two squares
|
// calculate the bearing between two squares
|
||||||
function bearing($tx, $rx, $unit = 'M') {
|
function bearing($tx, $rx, $unit = 'M') {
|
||||||
$my = qra2latlong($tx);
|
if(strlen($tx) <= 6 && strlen($rx) <= 6) {
|
||||||
$stn = qra2latlong($rx);
|
$my = qra2latlong($tx);
|
||||||
|
$stn = qra2latlong($rx);
|
||||||
|
|
||||||
$bearing = bearing($my[0], $my[1], $stn[0], $stn[1], $unit);
|
$bearing = bearing($my[0], $my[1], $stn[0], $stn[1], $unit);
|
||||||
|
|
||||||
return $bearing;
|
return $bearing;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
正在加载…
在新工单中引用