From: Sarah Hoffmann Date: Tue, 25 Jun 2013 06:24:22 +0000 (+0200) Subject: more restrictive parsing of lat/lon X-Git-Tag: deploy~601 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/6b7c81aceea666a356da7cde2d4eea9ab459d404 more restrictive parsing of lat/lon Require a decimal point in both numbers to avoid cases like https://trac.openstreetmap.org/ticket/4884 --- diff --git a/website/search.php b/website/search.php index 9c8c8a6e..aa0e870a 100755 --- a/website/search.php +++ b/website/search.php @@ -270,7 +270,7 @@ $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]+[0-9]*\\.[0-9]+)(\\]|$|\\b)/', $sQuery, $aData)) { $fQueryLat = $aData[2]; $fQueryLon = $aData[3];