X-Git-Url: https://git.openstreetmap.org/nominatim.git/blobdiff_plain/6c1977b448e8b195bf96b6144674ffe0527e79de..27bc8d4f7bb907699dbb974e8159f75bead831c9:/website/reverse.php diff --git a/website/reverse.php b/website/reverse.php index b6d0f5e6..4ce5833f 100755 --- a/website/reverse.php +++ b/website/reverse.php @@ -41,7 +41,7 @@ if ($sOsmType && $iOsmId > 0) { if ($oLookup) { $aPlaces = $oPlaceLookup->lookup(array($oLookup->iId => $oLookup)); - if (sizeof($aPlaces)) { + if (!empty($aPlaces)) { $aPlace = reset($aPlaces); } } @@ -72,8 +72,10 @@ if (CONST_Debug) { } if ($sOutputFormat == 'html') { - $sDataDate = chksql($oDB->getOne("select TO_CHAR(lastimportdate - '2 minutes'::interval,'YYYY/MM/DD HH24:MI')||' GMT' from import_status limit 1")); + $sDataDate = chksql($oDB->getOne("select TO_CHAR(lastimportdate,'YYYY/MM/DD HH24:MI')||' GMT' from import_status limit 1")); $sTileURL = CONST_Map_Tile_URL; $sTileAttribution = CONST_Map_Tile_Attribution; } -include(CONST_BasePath.'/lib/template/address-'.$sOutputFormat.'.php'); + +$sOutputTemplate = ($sOutputFormat=='jsonv2' ? 'json' : $sOutputFormat); +include(CONST_BasePath.'/lib/template/address-'.$sOutputTemplate.'.php');