more strict parameter checking for reverse

This commit is contained in:
Sarah Hoffmann
2015-03-17 21:05:54 +01:00
parent ef48ee5f80
commit 753227ae25
3 changed files with 54 additions and 3 deletions

View File

@@ -45,10 +45,8 @@
$oPlaceLookup->setOSMID($_GET['osm_type'], $_GET['osm_id']);
$aPlace = $oPlaceLookup->lookup();
//if (!$iPlaceID) $sError = 'OSM ID Not Found';
}
else
else if (isset($_GET['lat']) && isset($_GET['lon']) && preg_match('/^[+-]?[0-9]*\.?[0-9]+$/', $_GET['lat']) && preg_match('/^[+-]?[0-9]*\.?[0-9]+$/', $_GET['lon']))
{
$oReverseGeocode = new ReverseGeocode($oDB);
$oReverseGeocode->setLanguagePreference($aLangPrefOrder);
@@ -59,6 +57,10 @@
$aPlace = $oReverseGeocode->lookup();
}
else
{
$aPlace = null;
}
if (CONST_Debug) exit;