From 5e2b9011067cdf902476eac196fbd3b5dca7e597 Mon Sep 17 00:00:00 2001 From: Brian Quinion Date: Tue, 2 Aug 2011 19:39:32 +0000 Subject: [PATCH] fix miss-parsed regex with - sign in lat,lon query --- website/search.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/website/search.php b/website/search.php index 0de922f9..4a75c768 100755 --- a/website/search.php +++ b/website/search.php @@ -101,7 +101,6 @@ $aPhrases = array_reverse($aPhrases); $sQuery = join(', ',$aPhrases); } - if ($sQuery) { $hLog = logStart($oDB, 'search', $sQuery, $aLangPrefOrder); @@ -192,7 +191,7 @@ $_GET['nearlon'] = ($aData[6]=='E'?1:-1) * ($aData[4] + $aData[5]/60); $sQuery = trim(str_replace($aData[0], ' ', $sQuery)); } - elseif (preg_match('/(\\[|\\b)(-?[0-9]+[0-9.]*)[, ]+(-?[0-9]+[0-9.]*)(\\]|\\b)/', $sQuery, $aData)) + elseif (preg_match('/(\\[|^|\\b)(-?[0-9]+[0-9.]*)[, ]+(-?[0-9]+[0-9.]*)(\\]|$|\\b)/', $sQuery, $aData)) { $_GET['nearlat'] = $aData[2]; $_GET['nearlon'] = $aData[3];