From 0bcd0ca90858901f0691ca245e61d159e2c2ce38 Mon Sep 17 00:00:00 2001 From: dg9vh Date: Sun, 28 Aug 2016 19:46:08 +0000 Subject: [PATCH] fixed name lookup to not look up partials --- include/functions.php | 7 ++++--- version.php | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/include/functions.php b/include/functions.php index 9d0fe02..4a8c8ad 100644 --- a/include/functions.php +++ b/include/functions.php @@ -489,10 +489,11 @@ function getName($callsign) { if (strpos($callsign,"-")) { $callsign = substr($callsign,0,strpos($callsign,"-")); } - exec("grep ".$callsign." ".DMRIDDATPATH, $output); $delimiter =" "; - if (strpos($output[0],"\t")) { - $delimiter = "\t"; + exec("grep -P '".$callsign.$delimiter."' ".DMRIDDATPATH, $output); + if (count($output) == 0) { + $delimiter = "\t"; + exec("grep -P '".$callsign.$delimiter."' ".DMRIDDATPATH, $output); } $name = substr($output[0], strpos($output[0],$delimiter)+1); $name = substr($name, strpos($name,$delimiter)+1); diff --git a/version.php b/version.php index 90461b2..20ee740 100644 --- a/version.php +++ b/version.php @@ -1,3 +1,3 @@ \ No newline at end of file