From: Sarah Hoffmann Date: Tue, 25 Jun 2013 06:24:22 +0000 (+0200) Subject: more restrictive parsing of lat/lon X-Git-Tag: v2.2.0~54 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/ea761a15b6b4bc430ef51c192c8ee4c7a7133a54?hp=fe1e53ef04ae0d1ee2433973667f252c8903e674 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 18fcbafc..272324b1 100755 --- a/website/search.php +++ b/website/search.php @@ -266,7 +266,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];