]> git.openstreetmap.org Git - nominatim.git/blobdiff - website/reverse.php
spacing changes after lonvia PR feedback
[nominatim.git] / website / reverse.php
index 85ca19816b196662b7864374c1d8b5863e264fdf..4ce5833f6129bb9a884a5ae6ee0708e7ac29f2fd 100755 (executable)
@@ -41,12 +41,12 @@ if ($sOsmType && $iOsmId > 0) {
 
     if ($oLookup) {
         $aPlaces = $oPlaceLookup->lookup(array($oLookup->iId => $oLookup));
-        if (sizeof($aPlaces)) {
+        if (!empty($aPlaces)) {
             $aPlace = reset($aPlaces);
         }
     }
 } elseif ($sOutputFormat != 'html') {
-    userError("Need coordinates or OSM object to lookup.");
+    userError('Need coordinates or OSM object to lookup.');
 }
 
 if (isset($aPlace)) {
@@ -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');