From 50ae750bb54c0a069394c64ca637b8f47e750671 Mon Sep 17 00:00:00 2001 From: phl0 Date: Wed, 18 Jan 2017 12:11:59 +0100 Subject: [PATCH] Add canonicalization also to localTx table --- ajax.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/ajax.php b/ajax.php index c7b47fa..c5e3508 100644 --- a/ajax.php +++ b/ajax.php @@ -27,15 +27,17 @@ if ($_GET['section'] == "localTx") { $lastHeard = Array(); for ($i = 0; $i < count($localTXList); $i++) { $listElem = $localTXList[$i]; + // Generate a canonicalized call for QRZ and name lookups + $call_canon = preg_replace('/\s+\w$/', '', $listElem[2]); if (defined("ENABLEXTDLOOKUP")) { if ($listElem[6] == "RF" && ($listElem[1]=="D-Star" || startsWith($listElem[1], "DMR") || $listElem[1]=="YSF" || $listElem[1]=="P25")) { - $listElem[3] = getName($listElem[2]); + $listElem[3] = getName($call_canon); if ($listElem[2] !== "??????????") { if (!is_numeric($listElem[2])) { if (defined("SHOWQRZ")) { - $listElem[2] = "".str_replace("0","Ø",$listElem[2]).""; + $listElem[2] = "".str_replace("0","Ø",$listElem[2]).""; } else { - $listElem[2] = "".$listElem[2].""; + $listElem[2] = "".$listElem[2].""; } } else { $listElem[2] = "".$listElem[2].""; @@ -48,9 +50,9 @@ if ($_GET['section'] == "localTx") { if ($listElem[2] !== "??????????") { if (!is_numeric($listElem[2])) { if (defined("SHOWQRZ")) { - $listElem[2] = "".str_replace("0","Ø",$listElem[2]).""; + $listElem[2] = "".str_replace("0","Ø",$listElem[2]).""; } else { - $listElem[2] = "".$listElem[2].""; + $listElem[2] = "".$listElem[2].""; } } else { $listElem[2] = "".$listElem[2]."";