]> git.openstreetmap.org Git - nominatim.git/commitdiff
fix miss-parsed regex with - sign in lat,lon query
authorBrian Quinion <openstreetmap@brian.quinion.co.uk>
Tue, 2 Aug 2011 19:39:32 +0000 (19:39 +0000)
committerBrian Quinion <openstreetmap@brian.quinion.co.uk>
Tue, 2 Aug 2011 19:39:32 +0000 (19:39 +0000)
website/search.php

index 0de922f990a2f549452bc213bcf49fa1d0912f9d..4a75c768809b14b6a6204a1be4fae4e500534aab 100755 (executable)
                $aPhrases = array_reverse($aPhrases); 
                $sQuery = join(', ',$aPhrases);
        }
-
        if ($sQuery)
        {
                $hLog = logStart($oDB, 'search', $sQuery, $aLangPrefOrder);
                        $_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];