more restrictive parsing of lat/lon

Require a decimal point in both numbers to avoid cases like
https://trac.openstreetmap.org/ticket/4884
This commit is contained in:
Sarah Hoffmann
2013-06-25 08:24:22 +02:00
parent fe1e53ef04
commit ea761a15b6

View File

@@ -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];