From: Brian Quinion Date: Tue, 2 Aug 2011 19:39:32 +0000 (+0000) Subject: fix miss-parsed regex with - sign in lat,lon query X-Git-Tag: v2.0.0~130 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/5e2b9011067cdf902476eac196fbd3b5dca7e597 fix miss-parsed regex with - sign in lat,lon query --- 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];